How can I access netstat-like Ethernet statistics from a Windows program

The WMI will provide those readings: SELECT * FROM Win32_PerfFormattedData_Tcpip_IP SELECT * FROM Win32_PerfFormattedData_Tcpip_TCP SELECT * FROM Win32_PerfFormattedData_Tcpip_UDP SELECT * FROM Win32_PerfFormattedData_Tcpip_ICMP SELECT * FROM Win32_PerfFormattedData_Tcpip_Networkinterface These classes are available on Windows XP or newer. You may have to resign to the matching “Win32_PerfRawData” classes on Windows 2000, and do a little bit more of … Read more

Read MAC Address from network adapter in .NET

Since .Net 2.0 there’s been a NetworkInterface class in the System.Net.NetworkInformation namespace that will give you this information. Try this: foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) { if (nic.OperationalStatus == OperationalStatus.Up) { Console.WriteLine(nic.GetPhysicalAddress().ToString()); break; } }

How to use the host network, and any other user-defined network together in Docker-Compose?

TL;DR you can’t. The host networking turns off the docker network namespace for that container. You can’t have it both on and off at the same time. Instead, connect to your database with a published port, or a unix socket that you can share as a volume. E.g. here’s how to publish the port: version: … Read more