1C#POST 数据      string url = "http://192.168.1.127/xia/Server/xia.asp?COMMAND=Login&Account=puretime&Password=12345";
 2C#POST 数据
 3C#POST 数据            CookieContainer cookie = new CookieContainer ();
 4C#POST 数据
 5C#POST 数据            HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(url);
 6C#POST 数据
 7C#POST 数据            myRequest.AllowAutoRedirect = true;
 8C#POST 数据
 9C#POST 数据            myRequest.CookieContainer = cookie;
10C#POST 数据
11C#POST 数据            HttpWebResponse myresponse = (HttpWebResponse)myRequest.GetResponse();
12C#POST 数据
13C#POST 数据            myresponse.Cookies = cookie.GetCookies(myRequest.RequestUri);
14C#POST 数据
15C#POST 数据            Stream mystream = null;
16C#POST 数据
17C#POST 数据            mystream = myresponse.GetResponseStream();
18C#POST 数据
19C#POST 数据            StreamReader myreader = new StreamReader(mystream, System.Text.Encoding.Default, true);
20C#POST 数据
21C#POST 数据            string pagefile = myreader.ReadToEnd();
22C#POST 数据
23C#POST 数据            if (pagefile.IndexOf("<Value>1</Value>"> 0)//登入成功
24               w.Close();

 

相关文章:

  • 2021-06-25
  • 2021-06-12
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-14
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-09-20
相关资源
相似解决方案