下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 未来五年家居护垫市场需求变化趋势与商业创新机遇分析研究报告
- 未来五年农林企业ESG实践与创新战略分析研究报告
- 未来五年马的饲养企业数字化转型与智慧升级战略分析研究报告
- 未来五年生活服务企业ESG实践与创新战略分析研究报告
- 混合型塑胶跑道施工方案
- 基于深度学习的初中英语八年级下册《友谊:联结与沟通》模块整体教学设计方案
- 河道护坡冬季施工方案
- 外研版八年级英语下册 Module 3 Journey to Space 单元整体学习方案
- 企业年度谈判技巧培训方案
- 智能停车管理系统设计方案
- 加工中心操作工初级工考试试卷与答案
- 新生儿围生期感染护理查房
- 内蒙古呼和浩特市2025-2026学年高三上学期第一次质量监测 化学试卷
- 丈夫出轨婚内协议书范本
- 厚型防火涂料施工规范及操作流程
- 婚姻家庭矛盾纠纷调解
- 中性粒细胞缺乏症诊疗与管理体系
- 医院行政管理体系介绍
- (新版)液氯安全标签
- GB/T 21649.2-2025粒度分析图像分析法第2部分:动态图像分析法
- 南昌地铁保护管理办法
评论
0/150
提交评论