如何点击http://somewhere.com/client.php?locationID=1
并从C Windows窗体应用程序返回位置ID的值?
正在尝试从C Windows窗体应用程序获取HttpGetrequest。
不知道从哪里开始,也不知道怎么做。
谢谢

最佳答案

试试这个:

       HttpWebRequest request = (HttpWebRequest) WebRequest.Create(@"http://somewhere.com/client.php?locationID=1");
       HttpWebResponse response = (HttpWebResponse)request.GetResponse();
       string content = new StreamReader(response.GetResponseStream()).ReadToEnd();

07-27 17:55