通过下面的语句可以得到一个字符串,想要从字符串中获取本机电脑的所有网卡的物理地址(也就是mac地址)Dim p As new Process()
p.StartInfo.FileName = "cmd.exe"
p.StartInfo.UseShellExecute = False '关闭Shell的使用
p.StartInfo.RedirectStandardInput = True '重定向标准输入
p.StartInfo.RedirectStandardOutput = True '重定向标准输出
p.StartInfo.RedirectStandardError = True '重定向错误输出
p.StartInfo.CreateNoWindow = True '设置不显示窗口
p.Start()
p.StandardInput.WriteLine("ipconfig/all")
p.StandardInput.WriteLine("exit")
Dim strRst As String = p.StandardOutput.ReadToEnd()
output.show(strRst)
上面的strRst会得到很多信息,现在需要将里面的物理地址单独提取出来,用“;”分号来做分隔符号的一个组合字符串