老问题了。大家来看下
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 = ? 什么呢?
}
{
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 = ? 什么呢?
}
...全文
相关推荐
评论:对待老员工问题的“四项基本原则”.docx
评论:对待老员工问题的“四项基本原则”.docx
对煤矿探放老空水钻孔布置中的几个问题的探讨
通过阐述煤矿老空水探放钻孔布置帮距的合理性和探水钻孔终孔位置钻孔间距与孔间距的矛盾,提出了“帮距”的新概念,统一了对探水钻孔终孔位置钻孔间距与孔间距的认识,明确了探水钻孔横向钻孔间距和纵向钻孔间距的要求是在掘进停掘位置。对煤矿探放老空水钻孔布置具有较强的指导意义。
精品资料(2021-2022年收藏的)老工业园区的消防问题及整顿措施.doc
精品资料(2021-2022年收藏的)老工业园区的消防问题及整顿措施.doc
社区“一老一小”服务供给现状及问题分析.pdf
社区“一老一小”服务供给现状及问题分析.pdf
pos、ansipos、fillchar在delphi2010中unicode的问题老代码升级.mht
pos、ansipos、fillchar在delphi2010中unicode的问题老代码升级.mht


