


下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年个人征信基础考试:征信报告分析与应用实务试题集锦含答案
- 2025年A股投资策略分析报告:消费定海神针
- 海洋生态养殖富农策略
- 老年用药安全课件
- 老年护理专科课件
- 老师这个职业
- 餐饮厨师职业晋升与薪酬调整合同
- 茶馆与茶叶种植技术研究院合作协议
- 老妖老师消防课件笔记
- 车辆购置税减免及退税合同协议
- 亲社会倾向量表(26题版)
- 2022年浙江绍兴市新闻传媒中心招聘工作人员笔试备考题库及答案解析
- 施工现场临时用电验收表参考模板范本
- 煤矿门益门区益门
- 八年级语文课外文言文阅读 专项训练
- 国际贸易出口业务一般流程
- 2023年物流公司介绍PPT
- 2023山西高考志愿填报指南(详细)
- GB/T 8431-1998纺织品色牢度试验光致变色的检验和评定
- GB/T 19889.5-2006声学建筑和建筑构件隔声测量第5部分:外墙构件和外墙空气声隔声的现场测量
- GB/T 18391.1-2009信息技术元数据注册系统(MDR)第1部分:框架
评论
0/150
提交评论