当前位置:首页 > 开发 > C# > 正文内容

C# 获取网页源代码

C#4年前 (2022-10-26)
private static string GetHtml(string url)
{
WebClient myWebClient = new WebClient();
byte[] myDataBuffer = myWebClient.DownloadData(url);
myWebClient.Dispose();
return Encoding.UTF8.GetString(myDataBuffer);
}


转载请注明出处。

本文链接:http://pythonopen.com/?id=230

相关文章

C# 标准日期和时间格式说明符

Code说明Write备注Y年月2022年7月y标准日期和时间格式说明符2022年7月单独使用时y年...

C# 获取程序运行路径

AppDomain.CurrentDomain.BaseDirectory...

C# System.IO.Path

System.IO.Path.GetExtension返回指定的路径字符串的扩展名。string&n...

C# Graphics文本抗锯齿

g.TextRenderingHint = TextRenderingHint....

C# using与多重using

1. using 语句概述在 C# 中,using 语句主要用于确保实现了 IDisposable...

C# TextRenderer.MeasureText

TextRenderer.MeasureText是System.Windows.Forms命名空间中...