Just like the screenshot, I want to use C# to set the Link Speed and Duplex mode for Network adapters. For example, change the settings from Auto Negotiation to 10 Mbps Half Duplex.
Could you please point me out that how to start?
Thanks
SuT
Just like the screenshot, I want to use C# to set the Link Speed and Duplex mode for Network adapters. For example, change the settings from Auto Negotiation to 10 Mbps Half Duplex.
Could you please point me out that how to start?
Thanks
SuT
The windows network configuration dll's are poorly (in best cases) documented. The easiest way for configuring values in the network is using netsh
Best way to programmatically configure network adapters in .NET
The netsh calls the weird undocummented windows dll's. If you need call directly a dll instead of executing a command, you can start debugging the netsh.
You can use C# to change the registry value of DuplexSpeed in the registry key
HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0001
that I found from here, https://superuser.com/questions/258746/change-nic-speed-duplex-settings-in-script .The number at the end will differ, but you can look at the DriverDesc
value of the keys to see the name of the network device.
See http://tech.pro/tutorial/652/csharp-snippet-tutorial-editing-the-windows-registry for editing registry values with C#.