Access and monitor USB devices over a TCP/IP network. Connect USB peripheral devices anywhere on a Local Area Network (LAN) without a locally-attached.
I have a C# application in which I need to detect a USB to Ethernet adapter connected to a PC and set it with a static IP address. The adapter can be of any brand, I don't know which one the end user will have. All I do know is that it will be only one USB to Ethernet adapter connected to that PC.
Here is my current code which should have worked:
But, unfortunately , it doesn't and when I run
ipconfig
the IP is not set to 10.0.0.2 and this makes other parts of my app that tries to ping
it to fail...When I debug the code I see that it does find a
ManagementObject
with the description 'USB to Ethernet Adapter' but its IP doesn't change.I searched the web and found on MSDN this code sample that uses
NetworkInterface
so I tried this:Is there a 100% way to detect that single USB adapter and set it with the static IP?
Liran FriedmanLiran Friedman