如题
解决方案 »
- treeview中选中父子节点后并返回值用于权限设置
- 为什么工具栏就、状态栏等调试时看不到?
- 用数组怎么实现最短寻道时间优先算法(C#)
- The transaction has already been implicitly or explicitly committed or aborted
- C#如何关于sql分布式的问题
- 如何判断datagrid中的checkbox被checked了呢?
- 急求关于vs2008的解析
- 如何屏蔽其他操作,使当前窗口成为唯一活动的窗口?
- 从存储过程中返回参数的问题
- C#中WPF部分TextBlock控件中的Text的值被转义为符号,这是为什么?
- 三层开发namespace 问题
- C#程序内存泄漏问题【调用IE内核,数据库连接等组件】
thScan.Start();//... public class ComputerAddressInfo
{
private int startIP = 0;
private int endIP = 0;
private string ipPrefix = "";
private ArrayList computerList = null; public ComputerAddressInfo(string ipPrefix, int startIP, int endIP)
{
this.startIP = startIP;
this.endIP = endIP;
this.ipPrefix = ipPrefix;
computerList = new ArrayList();
} public void ScanComputers()
{
for (int i = startIP; i <= endIP; i++)
{
string scanIP = ipPrefix + "." + i.ToString();
IPAddress myScanIP = IPAddress.Parse(scanIP);
IPHostEntry myScanHost = null;
string[] arr = new string[2]; try
{
myScanHost = Dns.GetHostByAddress(myScanIP);
}
catch
{
continue;
} if (myScanHost != null)
{
arr[0] = myScanHost.HostName;
arr[1] = scanIP; computerList.Add(arr);
}
}
}
}