Note: In case you're curious about the code, here it is:
(e.g., IPAddress = 192.168.1.108, Action = start, Channel = 1, Code = Position, Arg1 = 20, Arg2 = 30, Arg3 = 5)
Code: Select all
Dim CommandString As String = "http://" & IPAddress & "/cgi-bin/ptz.cgi?action=" & Action & "&channel=" & Channel & "&code=" & Code & "&arg1=" & Arg1 & "&arg2=" & Arg2 & "&arg3=" & Arg3
Dim client As HttpClient
Dim handler As New WebRequestHandler
Dim result As New HttpResponseMessage
handler.Credentials = New NetworkCredential(Username, Password)
client = New HttpClient(handler)
client.BaseAddress = New Uri(CommandString)
client.Timeout = TimeSpan.FromMilliseconds(-1)
result = Await client.GetAsync(CommandString, HttpCompletionOption.ResponseHeadersRead)
result.EnsureSuccessStatusCode()