Windows Application's Operation of Web Page

xiaoxiao2021-03-06  51

Simple

String lcurl = "http://www.jcedu.org";

HTTPWebRequest Lohttp = (httpwebrequest) WebRequest.create (LCURL); // *** Expired Time Lohttp.timeout = 10000; // 10 second Lohttp.Userage = "code Sample Web Client"; // *** Get a response file head HttpWebResponse loWebResponse = (HttpWebResponse) loHttp.GetResponse (); Encoding enc = Encoding.GetEncoding (1252); StreamReader loResponseStream = new StreamReader (loWebResponse.GetResponseStream (), enc); string lcHtml = loResponseStream.ReadToEnd (); loWebResponse.Close (); loresponsestream.close ();

转载请注明原文地址:https://www.9cbs.com/read-116565.html

New Post(0)