开发者

How to find the IP address(DHCP) of a UPNP device on the network through c# code

开发者 https://www.devze.com 2023-01-18 00:53 出处:网络
I have a UPNP device plugged into the wall. It shows up in network places as a UPNP device, I can get the IP address by right clicking and and selectin开发者_JAVA百科g properties, but I need to know h

I have a UPNP device plugged into the wall. It shows up in network places as a UPNP device, I can get the IP address by right clicking and and selectin开发者_JAVA百科g properties, but I need to know how to get the IP address dynamically in c# code or though a command window could also work.


You are looking for a flow called "UPnP Discovery".

Your C#-Code must broadcast UPnP Seach Requests, these are UDP multicast packets. Your UPnP devices will in turn send UPnP Search Responses, these are UDP unicast packets.

An UPnP Search Response contains an HTTP address to retrieve the XML description of the devices root device description. The host in the HTTP address typically is the devices network address.

Have a look at the UPnP spec.

0

精彩评论

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