zoukankan      html  css  js  c++  java
  • 用代码向网站提交数据

    用代码向网站提交数据

    左直拳

     

    可以用代码模拟浏览器向网站提交数据:

    string sUrl = "http://。。。。";//目标网址

    Uri target = new Uri(sUrl);

    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(target);

     

    req.ReadWriteTimeout = 10000;

    req.Timeout = 10000;

    req.MaximumAutomaticRedirections = 5;

    req.MaximumResponseHeadersLength = 5;

    req.AllowAutoRedirect = true;

    //装扮成一个浏览器,欺骗那个网址

    req.UserAgent = "Mozilla/6.0 (compatible; MSIE 6.0; Windows NT 5.1)";

     

    req.Method = "POST";

    req.ContentType = "application/x-www-form-urlencoded";

    string postData = "voteid=15196&markinfo=0&checktype=2&op=69884";//传递的数据

    byte[] arPostData = Encoding.UTF8.GetBytes(postData);

    req.ContentLength = arPostData.Length;

    Stream newStream = req.GetRequestStream();

    newStream.Write(arPostData, 0, arPostData.Length);

    newStream.Close();

     

    如果目标网址需要输入验证码,则死翘翘。

     
  • 相关阅读:
    特征可视化技术(CAM)
    特征可视化技术(CAM)
    attention
    attention
    Aggregated Residual Transformations for Deep Neural Networks(ResNeXt)
    attention
    attention
    位姿估计
    attention
    通过几个例子看下seajs模块标识符(有图有真相)
  • 原文地址:https://www.cnblogs.com/leftfist/p/4258306.html
Copyright © 2011-2022 走看看