标签:encoding ace data cli string iframe 地址 client 请求
前台
<div id="divUrlDetail" runat="server">
</div>
后台
protected void Page_Load(object sender, EventArgs e)
{
divUrlDetail.InnerHtml = new BPMDataService().GetHtmlByUrl("你的链接地址");
}
public string GetHtmlByUrl(string url)
{
WebClient MyWebClient = new WebClient();
MyWebClient.Credentials = CredentialCache.DefaultCredentials;//获取或设置用于向Internet资源的请求进行身份验证的网络凭据
Byte[] pageData = MyWebClient.DownloadData(url); //从指定网站下载数据
string pageHtml = Encoding.UTF8.GetString(pageData);
pageHtml = System.Text.RegularExpressions.Regex.Replace(pageHtml, @"<input[\s\S]+?/>", "");
pageHtml = pageHtml.Replace("Print", "");
return pageHtml;
}
标签:encoding ace data cli string iframe 地址 client 请求
原文地址:http://www.cnblogs.com/wangshishuifeng2016/p/6296655.html