|
Oh, this is an ASP.NET question, or just the site you launch from your winforms app is your own to control ? The way to pass parameters to a web page is to put them on the query string.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Process.Start("http://www.codeproject.com");
This opens the page in the default browser (Firefox on my machine).
I think the correct way is Process.Start("iexplore.exe");
|
|
|
|
|
Yeah, I said it opens the default browser. If you want to force IE, you need to pass the URL as an argument, that may work.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: Yeah, I said it opens the default browser.
Actually you didn't say that anywhere
|
|
|
|
|
you're right
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: will open a new IE window
Thats not quite true. If there is an open window it will hijack it, and redirect to the supplied webpage. Actually calling iexplore.exe will definately open a new window. I did write up some code a while ago, to find the users default browser and start a new instance of it on a webpage. I hate when something starts taking over my browser windows.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
I have written a C# app, where I used WebBrowser control to visit any webpage. If there is a download in this page, and I want to download it IE7 default download manager pops up and starts download. But I want to use custom download manager (viz. one embedded with my app) to download file from webbrowser control.
How to solve the problem? Please help me. I am stuck there.....
Thank you in advance.
Anindya Chatterjee
|
|
|
|
|
Right then. WebBrowser has an event for Navigating , which gets called just before the control starts redirects to the new url.
You'll need to use the event, and check the extension of the file being downloaded. If the extension is any kind of webpage (htm, html, asp, etc) then you can just ignore it. If the extension is something else (rar, mp3, doc, etc) then you will need to cancel the event, and start your custome downloading code on the url.
A quick example:
void WebBrowser1Navigating(object sender, WebBrowserNavigatingEventArgs e)
{
if(e.Url.AbsoluteUri.EndsWith(".html"))
{
return;
}
e.Cancel;
}
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
what if it goes to an ASP, PHP, ASPX, DHTML, SHTML, JSP, ect.. page?!?!
You "could" create a web client object that spits it's request into the webbrowser control to be displated. Then you have access to the HTTP headers! but, then you can't port it over to the compact framework without lots of work openNETCF library only to find a bug in openNETCF and have your project grind to a halt to be canceled
|
|
|
|
|
You mean if you go to an asp page and then it automatically downloads a file? Because i think that would trigger the Navigating event as well.
If you mean i only put in an if statement for html, then it was just an example of how you could solve the problem.
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
The problem with that is you can't account for every type of viewable file on the web
ranting about how you can't grab the HTTP headers from the web browser control, as I've been in a similar issue trying to "capture" POST data from the web browser...
-Spacix
All your skynet questions[ ^] belong to solved
I dislike the black-and-white voting system on questions/answers.
|
|
|
|
|
Thanks, very much. My problem has been solved by your solutions. Thanks again.
Anindya Chatterjee
|
|
|
|
|
I have to use SGEN on an strongly named assembly that uses XmlSerializer
"sgen.exe"
"$(TargetPath)"
/f
/out:"$(TargetDir).."
/compiler:/keyfile:"d:\new folder\outlookSyncSign.snk"
The problem is that if the folder where the strong name key file has spaces the command will be unsuccessful. How can I overcome this without changing the name of the folder where the strong name resides?
|
|
|
|
|
try reating a batch file, then run the batch file from the post build event. You could pass in the target path and the output location if necessary, or just "hard code" them in the batch file...
|
|
|
|
|
it seems i get the same result using the batch file also, this is what i placed in the batch file
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe"
"c:\myApp.exe"
/f
/out:"d:\new folder"
/compiler:/keyfile:"d:\new folder\myAppsnk.snk"
I found this post And they it's a bug with sgen but i'm not sure i understood the workaround
|
|
|
|
|
If you put the path in quotes then you shouldn't have a problem.
|
|
|
|
|
as you can see in my post, the path is in quotes, it seems, according to this guy that's is a bug in sgen tool here
I tried using a batch file but i get the same result
|
|
|
|
|
i had developed a user control in c# and now want to implement a tab key functionality as in MS Word
how to replace the '\t' with correct number of spaces
e.g.
This is sample text
This is sample text a
|
|
|
|
|
I'm not sure what you are asking. It sounds like you have a user control with a TextBox or similar, and when the user is typing in text, you want to replace a TAB character with an appropriate number of spaces. Is that it or something else?
What part is giving you trouble? Detecting that the user pressed the TAB key? Calculating how many spaces to use? Other...?
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
yes u got it right.
i m having trouble in calculating how many spaces to use.
|
|
|
|
|
I think I can help you with that. Here is a little bit of code that you can adapt. I haven't tried this in C# but it's based on some C code I wrote a few years ago to replace tab characters in a text file with the appropriate number of spaces.
I'm assuming that you have a function that is called when the user presses a key, and that we've detected that the newest key press was a TAB character.
const int TabSpace = 8;
int CharsToAdd = (Control.Text.Length + 1) % TabSpace;
CharsToAdd = CharsToAdd ? TabSpace + 1 - CharsToAdd : 1;
while (CharsToAdd --)
Control.Text = Control.Text + " ";
I'm also assuming that Control.Multiline == false. If it's set to true, then you'd need to find the start of the current line. That would be the first character after the "\r\n" and you'd replace Control.Text.Length by the current character position relative to the start of the line. (The first character after the "\r\n" is character zero.)
I hope this A) makes sense, B) helps.
BDF
A learned fool is more a fool than an ignorant fool.
-- Moliere
|
|
|
|
|
hi
i use this code to show all databases in my sql server in treeView :
this.treeView1.Nodes.Clear();<br />
<br />
SQLServerClass m_sqlServer = new SQLServerClass();<br />
m_sqlServer.LoginSecure = true;<br />
m_sqlServer.Connect(".", "", "");<br />
<br />
TreeNode database; <br />
TreeNode storedProcedure;<br />
TreeNode storedProcedureParameter;<br />
<br />
foreach (Database2 db in m_sqlServer.Databases)<br />
{<br />
if (!db.SystemObject)<br />
{<br />
database = new TreeNode(db.Name);<br />
foreach (StoredProcedure2 sp in db.StoredProcedures)<br />
{<br />
if (!sp.SystemObject)<br />
{<br />
storedProcedure = new TreeNode(sp.Name); <br />
database.Nodes.Add(storedProcedure);<br />
}<br />
}<br />
this.treeView1.Nodes.Add(database);<br />
}<br />
}
and now when i iterate through stored procedures, i want to get all parameters for current stored procedure via SQLDMO, but how to do ?
thanks
|
|
|
|
|
QueryResults res = sp.EnumParameters();
|
|
|
|
|
thanks Rob Graham
i know this, but how to access type,length,isOutput,... for each column in my loop?
thanks again
|
|
|
|
|
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["ProFeeRevenueUser"].ConnectionString);
try
{
conn.Open(); // connect to the database
TreeView1.Nodes.Clear();
DataTable dt = new DataTable();
dt = conn.GetSchema("ProcedureParameters");
DataView view = dt.DefaultView;
view.Sort = "specific_name, ordinal_position";
string ProcedureName = "";
DataRowView dr;
IEnumerator ViewEnum = view.GetEnumerator();
while(ViewEnum.MoveNext())
{
dr = (DataRowView)ViewEnum.Current;
if (!dr["specific_name"].ToString().StartsWith("dt_"))
{
if (ProcedureName != dr["specific_name"].ToString())
{
TreeNode ProcedureNode = new TreeNode(dr["specific_name"].ToString());
TreeView1.Nodes.Add(ProcedureNode);
ProcedureName = dr["specific_name"].ToString();
}
StringBuilder sb = new StringBuilder(dr["parameter_name"].ToString());
sb.Append(" ");
sb.Append(dr["data_type"].ToString());
sb.Append(" ");
if (!dr.Row.IsNull("character_maximum_length"))
{
sb.Append("(");
sb.Append(dr["character_maximum_length"].ToString());
sb.Append(")");
sb.Append(" ");
}
sb.Append(dr["parameter_mode"].ToString());
TreeNode ProcedureParameterNode = new TreeNode(sb.ToString());
TreeView1.Nodes[TreeView1.Nodes.Count - 1].ChildNodes.Add(ProcedureParameterNode);
}
}
}
finally
{
if (conn.State == ConnectionState.Open)
conn.Close();
}
TreeView1.CollapseAll();
Someone's gotta be the last to know, but why is it always me?
|
|
|
|