Get a remote page via the WebRequest class.

xiaoxiao2021-03-06  45

/ / Set you want to get the page address to the URL

String URL = "

http://www.9cbs.net ";

URI ContentURL = New URI (URL);

WebRequest Req = WebRequest.create (ContentURL);

/ / Set as the default authentication method

Req.credentials = CredentialCache.defaultcredentials;

WebResponse Resp = Req.getResponse (); stream stream = resp.getResponseSstream (); streamreader sr = new streamreader; this.TextBox2.text = sr.readToeend (); sr.close ();

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

New Post(0)