开发者

How to connect to a device on network with c#

开发者 https://www.devze.com 2023-04-10 00:25 出处:网络
I have a device on my network that controls a p开发者_开发百科iece of hardware. I can control it with my browser like: http://xx.xx.xx.xxx/setvalue.html?Address_Value_Array={someValueToSendToDevice}

I have a device on my network that controls a p开发者_开发百科iece of hardware. I can control it with my browser like: http://xx.xx.xx.xxx/setvalue.html?Address_Value_Array={someValueToSendToDevice}

I do not need any form of a response from the device. I'm wondering what is the usual way to accomplish this sort of thing in c#. Thank you.


I would just use a System.Net.WebClient:

        using (System.Net.WebClient wc = new System.Net.WebClient())
        {
            wc.DownloadString("http://xx.xx.xx.xxx/setvalue.html?Address_Value_Array={someValueToSendToDevice}");
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消