zoukankan
html css js c++ java
C# 如何得到局域网中的计算机名?
private
void
ScanTarget()
{
string
strIPAddress
=
"
192.168.1.
"
;
//
Start scan address
int
nStrat
=
Int32.Parse(
"
1
"
);
//
Finish scan address
int
nEnd
=
Int32.Parse(
"
255
"
);
//
scan operation
for
(
int
i
=
nStrat;i
<=
nEnd;i
++
)
{
string
strScanIPAdd
=
strIPAddress
+
i.ToString();
//
convert to ip address
IPAddress myScanIP
=
IPAddress.Parse(strScanIPAdd);
try
{
//
get dns information
IPHostEntry myScanHost
=
Dns.GetHostByAddress(myScanIP);
//
get host name
string
strHostName
=
myScanHost.HostName.ToString();
this
.listBox2.Items.Add(strScanIPAdd
+
"
->
"
+
strHostName
+
"
\r
"
);
}
catch
{
continue
;
}
}
//
for
MessageBox.Show(
"
ok
"
);
}
查看全文
相关阅读:
CodeForces Round #545 Div.2
HDU 2222 Keywords Search
拓扑排序
CodeForces Round #553 Div2
CodeForces Round #552 Div.3
CodeForces Round #549 Div.2
#Leetcode# 997. Find the Town Judge
Educational Codeforces Round 62
#Leetcode# 524. Longest Word in Dictionary through Deleting
圆方树小结
原文地址:https://www.cnblogs.com/sskset/p/147621.html
最新文章
UVALive5870-Smooth Visualization-模拟水题
POJ2492-A Bug's Life-并查集扩展应用
POJ1611-The Suspects-并查集
POJ2236-Wireless Network-并查集
POJ3070-Fibonacci-矩阵快速幂
POJ3273-Monthly Expense-二分答案
POJ3258-River Hopscotch-二分答案
POJ1905-Expanding Rods-二分答案
POJ3122-Pie-二分答案
python学习笔记 day36 事件
热门文章
python学习笔记 da36 信号量
python学习笔记 day36 锁
python学习笔记 day36 进程(二)
python学习笔记 day35 进程(二)
python学习笔记 day35 操作系统 进程
python学习笔记 day34 FTP作业讲解
python学习笔记 day33 ftp大作业(未完成)
python学习笔记 day33 socketserver模块--解决TCP不能同时跟多个client同时通信的问题
python学习笔记 day33 验证客户端的合法性 hmac模块
CodeForces Round #544 Div.3
Copyright © 2011-2022 走看看