How to downlaod a picture ?
-
Hii I want to downlaod a picture using my application. I am able to download html pages. can u please tell me how to download picture. i am using this code.. HttpWebRequest webRequest; webRequest = (HttpWebRequest) WebRequest.Create ("http://www2.indiaresult.com/Uttar\_Pradesh/uptech/Rollquery.aspx?id=1116&linkid=NRollNo&rollno=01035" + j.ToString ()); HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse (); StreamReader sr = new StreamReader (webResponse.GetResponseStream(),Encoding.ASCII ); x = sr.ReadToEnd (); StreamWriter writer = new StreamWriter ("c:\\results\\"+ YearCollegeCode + j.ToString ()+".html",false); writer.Write (x); sr.Close (); writer.Close (); please help me. Thank u
-
Hii I want to downlaod a picture using my application. I am able to download html pages. can u please tell me how to download picture. i am using this code.. HttpWebRequest webRequest; webRequest = (HttpWebRequest) WebRequest.Create ("http://www2.indiaresult.com/Uttar\_Pradesh/uptech/Rollquery.aspx?id=1116&linkid=NRollNo&rollno=01035" + j.ToString ()); HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse (); StreamReader sr = new StreamReader (webResponse.GetResponseStream(),Encoding.ASCII ); x = sr.ReadToEnd (); StreamWriter writer = new StreamWriter ("c:\\results\\"+ YearCollegeCode + j.ToString ()+".html",false); writer.Write (x); sr.Close (); writer.Close (); please help me. Thank u
Take a look at the example listed on the HttpWebRequest.GetResponse [^] method, it shows exactly how to do it. - Nick Parker
My Blog | My Articles