老问题了。大家来看下
细细 2011-05-27 09:18:14 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 = ? 什么呢?
}