我是新手.我写一个程序,在C#4.0它非常适用于小范围的,但是当我去像A类IP地址范围,我的程序需要.需要大量的时间一些帮助.这里是让IP范围我代码(这不是一个好方法).有任何建议以更好的方式写作.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
namespace ipSplitt
{
class MainClass
{
public static void Main(string[] args)
{
string[] z = new string[4];
int t = 0;
string ip = "3.0.0.0";
string[] Ip = ip.Split(new char[] { '.' });
foreach (string m in Ip)
{
z[t] = m;
t++;
}
int a1, b1, c1, d1 = 0;
a1 = Convert.ToInt32(z[0]);
b1 = Convert.ToInt32(z[1]);
c1 = Convert.ToInt32(z[2]);
d1 = Convert.ToInt32(z[3]);
string[] v = new string[4];
string …Run Code Online (Sandbox Code Playgroud)