


下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 304钢水箱施工方案
- 小学课本剧《巨人的花园》-剧本
- 教师安全知识培训课件
- 江苏省无锡市长泾片重点名校2025届中考生物猜题卷含解析
- 临时导游聘用合同范例
- 供配电安装合同范例
- 单位内部组织合同范例
- 供货订货合同范例
- 仓库财务成本控制方案计划
- 常规班级活动的周期性评估计划
- 建筑垃圾处理及清运方案
- 流浪犬收容管理服务方案
- 全国高中青年数学教师优质课大赛一等奖《导数在研究函数中的应用》课件
- 矿山岩石力学教案
- 【海马汽车企业营运能力问题及解决策略(论文10000字)】
- 永安电力股份有限公司三台县凯河110千伏输变电新建工程环评报告
- 口腔颌面外科基础知识与基本操作-口腔颌面外科手术基本操作(口腔颌面外科课件)
- 学院(校)食堂餐饮企业承包经营退出管理制度
- 急危重症护理学3
- API520-安全阀计算PART1(中文版)
- 本科毕设论文--企业vpn的接入规划与设计
评论
0/150
提交评论