最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
vb.net显示用户ip 地址代码
时间:2022-06-25 05:34:27 编辑:袖梨 来源:一聚教程网
获取当前电脑名:system.net.dns.gethostname()
根据电脑名取出全部ip地址:system.net.dns.resolve(电脑名).addresslist 或
者 system.net.dns.gethostbyname(电脑名).addresslist根据ip地址取出电脑名
:system.net.dns.resolve(ip地址).hostname 下面我们就用一个实例来看如何获
取本机的ip地址,并获得我们的主机名称。
host and ip address
应用实例
在form_load事件中加入如下代码:
private sub form1_load(byval sender as system.object, byval e as
system.eventargs) handles mybase.load
dim address() as system.net.ipaddress
dim i as integer
address = system.net.dns.gethostbyname(system.net.dns.gethostname
()).addresslist
textbox1.text = system.net.dns.gethostname().tostring()
for i = 0 to ubound(address)
textbox2.text = textbox2.text & address(i).tostring() & chr(13) + chr
(10)
next
end sub
相关文章
- Linux系统中矢量图ai格式怎么打开? 09-26
- Linux怎么创建副本? Linux创建副本的教程 09-26
- linux下系统中网页版钉钉加密消息无法查看怎么办? 09-26
- Linux系统怎么关闭不用的进程? 09-26
- linux系统怎么设置终端透明? 09-26
- linux系统怎么录屏? linux录屏软件的使用方法 09-26