老问题了。大家来看下

细细 细细 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
void init_page()
{
string proxyIP = ConfigurationManager.AppSettings["proxyIP"]; //代理IP
string proxyPort = ConfigurationManager.AppSettings["proxyPort"]; //代理端口
string proxyUser = ConfigurationManager.AppSettings["proxyUser"]; //代理用户
string proxyPass = ConfigurationManager.AppSettings["proxyPass"]; //代理密码
WebProxy proxy = new WebProxy();
proxy.Address = new Uri(string.Format("http://{0}:{1}", proxyIP, proxyPort));
if (!string.IsNullOrEmpty(proxyUser) && !string.IsNullOrEmpty(proxyPass))
{
proxy.Credentials = new NetworkCredential(proxyUser, proxyPass);
}
string Htmlstring = GetHttpWebResponse(url_imdb, "", proxy);
Htmlstring = Regex.Replace(Htmlstring, @"<script[^>]*?>[\w\W]*?</script>", "", RegexOptions.IgnoreCase); // 清除脚本
Htmlstring = Regex.Replace(Htmlstring, @"<noscript[^>]*?>[\w\W]*?</noscript>", "", RegexOptions.IgnoreCase);// 清除非脚本
Htmlstring = Regex.Replace(Htmlstring, @"<meta[^>]*?>[\w\W]*?>", "", RegexOptions.IgnoreCase); // 清除meta
Htmlstring = Regex.Replace(Htmlstring, @"<iframe[^>]*?>[\w\W]*?</iframe>", "", RegexOptions.IgnoreCase); // 清除iframe
// 应该还需要清除多余部分
imdb.InnerHtml = Htmlstring;

// 显示imdb的其他信息

这是一个远程获取网站的方法。。现在报错远程主机强迫关闭了一个现有的连接的错误
我现在的意思 是 把该错误显示在网页中,怎么写。 imdb.InnerHtml = ? 什么呢?


}
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
细细
.NET社区 62,272 成员 668,968 内容