imports system
imports system.diagnostics
public class macaddress
public function getmac(byval ip as string) as string
dim str1 as string = string.empty
try
dim str2 as string = string.empty
dim info1 as processstartinfo = new processstartinfo()
dim process1 as process = new process()
info1.filename = "nbtstat"
info1.redirectstandardinput = false
info1.redirectstandardoutput = true
info1.arguments = "-a " + ip
info1.useshellexecute = false
process1 = process.start(info1)
dim num1 as integer = -1
while (num1 <= -1)
num1 = str2.trim().tolower().indexof("mac address", 0)
if (num1 > -1) then
exit while
end if
str2 = process1.standardoutput.readline()
process1.waitforexit()
str1 = str2.trim()
end while
catch ex as exception
throw ex
end try
return str1
end function
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


