public static void Test() { IPSubnet ipRange = new IPSubnet("10.10.10.0", 24); Console.WriteLine(ipRange.NetworkAddress); Console.WriteLine(ipRange.BroadcastAddress); ipRange.setRandom(false); foreach(System.Net.IPAddress ip in ipRange) { System.Console.Out.WriteLine(ip); } }
public virtual void testSubnet2() { try { IPSubnet subnet = new IPSubnet("10.10.10.0 255.255.255.0"); int count = 200; //UPGRADE_ISSUE: The following fragment of code could not be parsed and was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1156'" foreach(String ip in subnet) { //UPGRADE_TODO: Method 'java.io.PrintStream.println' was converted to 'System.Console.Out.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintStreamprintln_javalangObject'" System.Console.Out.WriteLine(ip); if (--count == 0) break; } } catch (System.Exception e) { // TODO Auto-generated catch block Console.Error.WriteLine(e.StackTrace); Assert.Fail(e.ToString()); } }
public virtual void testSubnet2() { try { IPSubnet subnet = new IPSubnet("10.10.10.0 255.255.255.0"); int count = 200; //UPGRADE_ISSUE: The following fragment of code could not be parsed and was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1156'" foreach (String ip in subnet) { //UPGRADE_TODO: Method 'java.io.PrintStream.println' was converted to 'System.Console.Out.WriteLine' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioPrintStreamprintln_javalangObject'" System.Console.Out.WriteLine(ip); if (--count == 0) { break; } } } catch (System.Exception e) { // TODO Auto-generated catch block Console.Error.WriteLine(e.StackTrace); Assert.Fail(e.ToString()); } }