public void TestGetSubnetMask() { var ip = Addressing.GetLocalIP(); var mask = Addressing.GetSubnetMask(ip); var amountHosts = Addressing.GetAmountOfHosts(mask); var maskNum = Addressing.ScanNetwork(ip, mask); }
private void buttonScan_Click(object sender, EventArgs e) { var localIP = Addressing.GetLocalIP(); if (localIP == null) { MessageBox.Show("You don't have a local IP Address. Are you connected to a network?", "Network error", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } var localMask = Addressing.GetSubnetMask(localIP); var hosts = Addressing.ScanNetwork(localIP, localMask); listBoxServers.DataSource = hosts; listBoxServers.DisplayMember = "Address"; }
public void TestGetNetworkAddress() { var ip = Addressing.GetLocalIP(); var mask = Addressing.GetSubnetMask(ip); var netAddr = Addressing.GetNetworkAddress(ip, mask); }