作者tkisky (FlyToast)
看板C_Sharp
标题[问题] HttpWebRequest 的使用
时间Thu Aug 28 17:39:21 2008
小弟专题在用ip webcam
最近碰到了一个问题
在网页上执行
http://url/cgi-bin/camctrl.cgi?move=right
可以让我的ipcam变方向
就是可以往右的意思
想说在我的程式上加上一个button
让我按一下就可以让它往右
以下是我的程式码
-------------------
// Creates an HttpWebRequest for the specified URL.
HttpWebRequest myHttpWebRequest =
(HttpWebRequest)WebRequest.Create("
http://url/cgi-bin/camctrl.cgi?move=right");
// Sends the HttpWebRequest and waits for a response.
HttpWebResponse myHttpWebResponse =
(HttpWebResponse)myHttpWebRequest.GetResponse();
// Get the response.
Stream streamResponse = myHttpWebResponse.GetResponseStream();
StreamReader streamRead = new StreamReader(streamResponse);
string responseString = streamRead.ReadToEnd();
// Close the stream object.
streamResponse.Close();
streamRead.Close();
// Releases the resources of the response.
myHttpWebResponse.Close();
---------------------
怎麽样就是不会动阿~~~(呐喊)
想请问一下我写的部分是那边错了?
谢谢板上的各位了
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.17.132.161
1F:→ mickfang:建立了Request,不用送什麽指令去触发吗? 08/30 04:58