c# 使用HttpWebRequest,HttpWebResponse 快速验证代理IP是否有用
来源:互联网 发布:阿里云ss 端口 编辑:程序博客网 时间:2024/06/06 08:39
我们可以使用HttpWebRequest,HttpWebResponse 来代理验证,谢谢大家评论指导!
呵呵,是不是很简单啊,其实这段代码改一下还可以做采集器,小偷等程序!我不说了大家自己看
public void yanzhen(string str, int port)
{
WebProxy proxyObject = new WebProxy(str, port);//str为IP地址 port为端口号
HttpWebRequest Req = (HttpWebRequest)WebRequest.Create("http://www.whatismyip.com.tw/");
Req.Proxy = proxyObject; //设置代理
//转载请标明来自 问题解决园http://wenti.cnblogs.com/
//文章地址
HttpWebResponse Resp = (HttpWebResponse)Req.GetResponse();
string str = "";
string OkStr = "";
Encoding code = Encoding.GetEncoding("UTF-8");
using (StreamReader sr = new StreamReader(Resp.GetResponseStream(), code))
{
if (sr != null)
{
try
{
str = sr.ReadToEnd();
StringSub.substr(str, "<h2>", "</h2>", 0);
str = str.Substring(str.IndexOf(start) + start.Length);
OkStr = str.Substring(0, str.IndexOf(last));
MessageBox.Show("验证成功!显示IP为" + OkStr);
}
catch
{
MessageBox.Show("文件读取失败!");
}
finally
{
sr.Close();
}
}
}
}
- c# 使用HttpWebRequest,HttpWebResponse 快速验证代理IP是否有用
- C# 使用HttpWebRequest,HttpWebResponse 快速验证代理IP是否有用
- c#使用HttpWebRequest,HttpWebResponse快速验证代理IP是否有用
- c# 快速验证代理IP是否有用
- c# 快速验证代理IP是否有用
- c# 快速验证代理IP是否有用
- c# 快速验证代理IP是否有用
- c# HttpWebRequest与HttpWebResponse
- c# HttpWebRequest与HttpWebResponse
- c# HttpWebRequest与HttpWebResponse
- 判断使用的代理IP是否有用
- C#使用HttpWebRequest和HttpWebResponse上传文件示例
- c# HttpWebRequest与HttpWebResponse 绝技
- c# HttpWebRequest与HttpWebResponse 绝技
- c# HttpWebRequest与HttpWebResponse 绝技
- c# HttpWebRequest与HttpWebResponse 绝技
- c# HttpWebRequest与HttpWebResponse 绝技
- python使用ip代理池,测试ip是否有用
- Struts的Model-2 MVC策略
- vc6.0的感悟
- 感悟
- (转)大树阶乘浅析
- 抓住终极目标(9.20)
- c# 使用HttpWebRequest,HttpWebResponse 快速验证代理IP是否有用
- 实践体会
- 抓住终极目标
- 深度破解MyEclipse
- [转]关闭不必要端口 让电脑固若金汤
- C++ 操作符优先级
- xp+apache+php配置问题小结
- 奋斗一小时,终于找回了优盘里"消失"的文件
- 新的起航