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
"
);
}
查看全文
相关阅读:
mac配置git和github
更新hosts后,如何清理edge的DNS缓存
初次运行 Git 前的配置
mac安装homebrew
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
AJAX
HTTP协议
HTTP状态码大全
SQL Servers数据库_删除
Hello Word
原文地址:https://www.cnblogs.com/sskset/p/147621.html
最新文章
Delphi中的接口和抽象类
权限表设计
Delphi中Owner和Parent的区别
PL/SQL报错:无法解析指定的连接标识符
reintroduce与override overload有何区别,怎么使用?
细小知识点总结
nginx之配置文件公用抽取
[部署日记]Android Studio在安装完后,sdk依旧提示SDK emulator directory is missing
PHP学习路线图
altera LTM触摸屏显示图像方法(引用)
热门文章
【转】sqlite3加密
安卓专利战:安卓侵犯了微软哪些专利?
delphi各种用法
屏幕截图、窗口截图、指定区域截图
通过文件头标识判断图片格式
Socket线程获取源码无阻塞
Visual c++ 2008 程序部署dll问题
Ubuntu Server 安装图解
jdk环境变量配置
mac重启后~/.bash_profile配置失效问题
Copyright © 2011-2022 走看看