简体   繁体   中英

The best way to hit a URL (I don't need a response) in Visual Basic.Net

I am basically sending a URL to control the tilt and pan of an IP camera, so all I need to do is send the request, I am not worried about receiving anything. Currently I am using:

Dim Request As HttpWebRequest = WebRequest.Create("http://xxx.xxx.xxx.xxx/nphControlCamera?Direction=TiltDown&Resolution=320x240&Quality=Standard&RPeriod=0&Size=STD&PresetOperation=Move&Language=3")
Dim Response As HttpWebResponse = Request.GetResponse

My problem here is, if I hit it two or three times it locks up my program. So what am I either doing wrong, or what is the best way to send this URL?

Thanks

You might have better luck calling it asynchronously, and preventing the user from sending the request again until the camera gets itself situated?

Basically you'd use BeginGetResponse instead of GetResponse.

This might be of use: How do you call an Asynchronous Web Request in VB.NET?

Are you returning any response at all from the camera? It seems like your program is waiting for a response and getting nothing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM