如何用WebBrowser读取html源文件,要c#代码
1个回答
展开全部
WebRequest request = WebRequest.Create("网址");
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("gb2312"));
textbox.Text = reader.ReadToEnd();
reader.Close();
reader.Dispose();
response.Close();
WebResponse response = request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), Encoding.GetEncoding("gb2312"));
textbox.Text = reader.ReadToEnd();
reader.Close();
reader.Dispose();
response.Close();
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询