C#的WebClient 任何使用带参数的网站源码查询

longhun1314 2014-05-13 12:05:46
C#的WebClient 任何使用带参数的网站源码查询,比如www.baidu.com/and 1 = 1 之类的差数
求方法!

string csh=this.txtcshu.txt
string path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + ("url.txt");
StreamReader rs = File.OpenText(path);
while ((url = rs.ReadLine()) != null)
{
if (!url.Contains("http://"))
{
url = "http://" + url;
richTextBox1.Text = string.Empty;
WebClient cli = new WebClient();
string shujl = cli.DownloadString(url + cshu);
cli.Encoding = Encoding.UTF8;
cli.Headers.Add("user-agent", "Baiduspider");
Stream stream = cli.OpenRead(url + cshu);
StreamReader rd = new StreamReader(stream);
string strTemp = string.Empty;
while ((strTemp = rd.ReadLine()) != null)
{
MessageBox.Show(strTemp);
}


}

这个是我写个测试的方法 一句话一句话 输出 测试的
...全文
173 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
longhun1314 2014-05-14
  • 打赏
  • 举报
回复
没有错 是我有一个地方 写错了所以没有获取到 谢谢了
宝_爸 2014-05-13
  • 打赏
  • 举报
回复
没看懂。 参数不是都是跟在?后面吗 像 https://www.google.com.au/search?q=csdn&oq=csdn&aqs=chrome..69i57j69i60l3j69i59j0.925j0j8&sourceid=chrome&es_sm=93&ie=UTF-8

110,539

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧