下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、4 个 text 控件, 2 个 command 控件dim strcomputer as string, ipaddress as string dim objwmiservice as object, ipconfigset as object, ipconfig, straddress private sub command1_click() call getip msgbox 获取成功 end sub private sub command2_click() call setip end sub private sub command3_click() label4(0).visibl
2、e = true label4(1).visible = true label4(2).visible = true label4(3).visible = true label4(4).visible = true end sub private sub form_load() dim i as integer strcomputer = . const c = , set objwmiservice = getobject(winmgmts: & strcomputer & rootcimv2) set ipconfigset = objwmiservice.execque
3、ry(select ipaddress fromwin32_networkadapterconfiguration where ipenabled=true) set ipconfigset = objwmiservice.execquery(select * from win32_networkadapterconfiguration where ipenabled=true) end sub function getip() as string text1.text = text2.text = text3.text = text4.text = for each ipconfig in
4、ipconfigset if not isnull(ipconfig.ipaddress) then for i = lbound(ipconfig.ipaddress) to ubound(ipconfig.ipaddress) text1.text = text1 + ipconfig.ipaddress(i) text2.text = text2 + ipconfig.ipsubnet(i) if ubound(ipconfig.ipaddress) i then text1.text = text1.text + c text2.text = text2.text + c end if
5、 next for i = lbound(ipconfig.defaultipgateway) to ubound(ipconfig.defaultipgateway) text3.text = text3.text + ipconfig.defaultipgateway(i) if ubound(ipconfig.defaultipgateway) i then text3.text = text3.text + c end if next for i = lbound(ipconfig.dnsserversearchorder) to ubound(ipconfig.dnsserverse
6、archorder) text4.text = text4.text + ipconfig.dnsserversearchorder(i) if ubound(ipconfig.dnsserversearchorder) i then text4.text = text4.text + c end if next end if next end function function setip() as string dim ip , subnetmask, gateway, dns dim errip, errgateway, errdns ip = array(text1.text) subnetmask = array(text2.text) gateway = array(text3.text) dns = array(text4.text) for each ipconfig in ipconfigset errip = ipconfig.enablestatic(ip , subnetmask) errgateway = ipconfig.setgateways(gateway) errdns = ipconfig.setdnsserversearchorder
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026安徽阜阳市界首农商银行春季校园招聘6人备考题库及完整答案详解1套
- 2026安徽蚌埠市固镇县仲兴镇和任桥镇选聘村级后备干部22人备考题库及答案详解(夺冠系列)
- 2026浙江宁波市慈城镇人民政府招聘合同制人员11人备考题库附答案详解(黄金题型)
- 2026崂山国家实验室海洋战略研究中心研究人员招聘备考题库及1套参考答案详解
- 2026安徽皖信人力资源管理有限公司招聘外委电力系统施工员3人备考题库附答案详解(达标题)
- 2026中国能源建设集团湖南省电力设计院有限公司社会招聘2人备考题库含答案详解(培优a卷)
- 2026重庆大学附属江津医院医院自聘岗位招聘16人备考题库附答案详解(b卷)
- 2026江苏苏州农业职业技术学院招聘20人备考题库含答案详解(研优卷)
- 2026四川宜宾江安县扶残助残协会社会招聘办公文员2人备考题库及参考答案详解1套
- 2026江苏徐州物资市场有限公司招聘6人备考题库及参考答案详解1套
- 材料力学试题库(含答案)
- 2021 年四川‘五类人员’选拔笔试题目及解析
- 工程监理现场巡视检查规程
- 2025年扫地机器人美国市场年度研报-
- 脑卒中急救绿色通道建设
- 2026年贵州省贵阳国家经济技术开发区招聘聘用制人员11人易考易错模拟试题(共500题)试卷后附参考答案
- 滚动轴承常见故障诊断案例分析
- (2025年)甘肃省兰州市【统招专升本】计算机真题(含答案)
- 部编版八年级历史下册第12课《民族大团结》课件
- 2025年口腔护理学第四版题库及答案
- 应急预案充电桩智能化
评论
0/150
提交评论