下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 五年阅读竞赛试题及答案
- 口腔考核试题及答案解析
- 2023年浙江省中考科学一轮专题辅导教学设计:人体三大系统
- 2025-2026学年花落谁家教案
- 2026年福建省漳平市高二化学下册期末考试模拟卷含答案(满分必刷)
- 2026年辽宁省凌源市高二化学下册期末考试模拟试卷及参考答案【轻巧夺冠】
- 2026年山西省原平市高二化学下册期末考试模拟考试卷附参考答案(B卷)
- 2026年湖南省津市市高二化学下册期末考试模拟卷附答案(巩固)
- 2025-2026学年紧急医学处理教案
- 2026年培训市场拓展活动方案策划
- 2026年精准扶贫知识测试题及答案
- 2026云南长水机场北高速公路有限责任公司就业见习人员招聘10人考试备考试题及答案详解
- 2025北京大兴九银村镇银行社会招聘笔试历年典型考题及考点剖析附带答案详解2套
- MOOC 跨文化交际通识通论-扬州大学 中国大学慕课答案
- 内蒙古科技大学往年C语言程序设计期末模拟及答案
- 2024届山东省青岛市青岛第二中学化学高二第二学期期末学业质量监测试题含解析
- 新员工入职手册
- 光伏居间合同
- 事故树分析方法FTA
- DB51-T 1148-2023梁山慈竹材用林经营技术规程
- NB/T 10731-2021煤矿井下防水密闭墙设计施工及验收规范
评论
0/150
提交评论