惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
T
Tailwind CSS Blog
Microsoft Azure Blog
Microsoft Azure Blog
The Cloudflare Blog
博客园 - 叶小钗
N
Netflix TechBlog - Medium
罗磊的独立博客
量子位
MyScale Blog
MyScale Blog
A
About on SuperTechFans
Blog — PlanetScale
Blog — PlanetScale
V
Visual Studio Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
GbyAI
GbyAI
B
Blog
腾讯CDC
爱范儿
爱范儿
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
F
Fortinet All Blogs
雷峰网
雷峰网
G
Google Developers Blog
Google DeepMind News
Google DeepMind News

博客园 - myer

使用you-get下载youtube视频 找不到org.springframework.context.ConfigurableApplicationContext的类文件 Centos7安装mysql8 无法加载oramts.dll 反射应用中的同种类型转换错误 - myer - 博客园 aspx文件生产静态html文件 在ASP.NET中实现Url Rewriting 正则表达式 c# 手机号码正则表达式 - myer - 博客园 jscalendar-1.0中文解决方法 GridView中嵌套GridView GridView 排序 开源软件FtpClient几个问题 CMM简介 C# ping命令的实现 DIV模式窗口的实现 .net中序列化和反序列化 ASP.net 本地化和国际化 C#编码规范
asp.net 小偷程序实现的原理和源码 - myer - 博客园
myer · 2007-03-28 · via 博客园 - myer

今天看了网上关于小偷程序的介绍自己做了分析。
下面就是实现的原理:
通过请求别人的服务器,通过得到的服务器的返回的数据进行 自己组装和拆分的到自己想要的内容 显示在页面上的下面是一个例子。
   string strURL = "其他网站的地址";
   HttpWebRequest request= (HttpWebRequest)WebRequest.Create(strURL);
   request.Method="POST";
   request.ContentType="application/x-www-form-urlencoded";
   string paraUrl = HttpUtility.UrlEncode("请求的参数");
   paraUrl = paraUrl + "=" + HttpUtility.UrlEncode(city, Encoding.GetEncoding("GB2312"));
   byte[] paraByte= Encoding.GetEncoding("GB2312").GetBytes(paraUrl);
   request.ContentLength = paraByte.Length;
   Stream writer = request.GetRequestStream();
   writer.Write(paraByte,0,paraByte.Length);
   writer.Close(); 

   HttpWebResponse response = (HttpWebResponse)request.GetResponse();
   Stream s= response.GetResponseStream();
   StreamReader objReader = new StreamReader(s,Encoding.GetEncoding("GB2312"));
   string strHTML = "";
   string strLine = "";
   int i = 0;
   while (strLine!=null)
   {
    i++;
    strLine = objReader.ReadLine();
    if (strLine!=null) 
     strHTML += strLine;
   } 
   strHTML = strHTML .Replace("&lt;","<");
   strHTML = strHTML .Replace("&gt;",">");
  这里的strHTML就是这个得到的html内容 然后进行字符串操作 就可以得到自己想要的信息了