It is really suprising how one thing leads to another and you end up learning a whole lot of things.I had to provide some mechanism for downloading a newer version for the client users.I thought i try out this "easy" .net class that does this job.
This is the WebClient class.The way to do this is as follows:
WebClient Client = new WebClient ();
Client.DownloadFile("
http://localhost/testpage.aspx","c:\\testpage.aspx");
This just did not work and we thought of doing it old way. Launch a browser and then give the url of the installer as an argument to it.
To get the default browser i had to shuffle through the registry :
RegistryKey rk = Registry.ClassesRoot.OpenSubKey("http\\shell\\open\\command");
string test = rk.GetValue("").ToString();
With this information we will have to first build a ProcessStateInfowith the above string as the first value and URL of the installer as the second argument.
ProcessStateInfo psi = new ProcessStateInfo(test,url);
I then had to call Process.Start(psi);
This will then show us the usual File Download window with the usual"open" "save" "cancel" and "more info" buttons.Phew.....