国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > .NET > 正文

Asp.Net獲取本地計算機和其他計算機的MAC值的方法

2024-07-10 12:56:49
字體:
來源:轉載
供稿:網友
public function valuesepr(byval rawstring as string, byval sepchar as string) as string
if instr(1, rawstring, sepchar) <> 0 then
valuesepr = microsoft.visualbasic.right(rawstring,len(rawstring) - instr(1, rawstring, sepchar))
else
valuesepr = rawstring
end if
end function
public function getmac(byval ip as string) as string
try
dim dirresults as string
dim psi as system.diagnostics.processstartinfo = new system.diagnostics.processstartinfo()
dim proc as new system.diagnostics.process()
psi.filename = "nbtstat"
psi.redirectstandardinput = false
psi.redirectstandardoutput = true
psi.arguments = "-a " & ip
psi.useshellexecute = false
proc = system.diagnostics.process.start(psi)
dim x as integer = -1
do until x > -1
if dirresults <> nothing then
x = dirresults.trim.tolower.indexof("mac address", 0)
if x > -1 then
exit do
end if
end if
dirresults = proc.standardoutput.readline
loop
proc.waitforexit()
getmac = valuesepr(dirresults.trim, "=").trim
catch err as exception
response.write(err.message & err.stacktrace)
end try
end function
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 柏乡县| 长葛市| 和静县| 深泽县| 乌兰浩特市| 绥芬河市| 衡东县| 吉木乃县| 新密市| 金川县| 喀什市| 江口县| 双流县| 兴隆县| 台北市| 临沧市| 九龙坡区| 高州市| 通榆县| 延安市| 丹江口市| 宁晋县| 广灵县| 蒙城县| 东方市| 区。| 敦煌市| 汕头市| 益阳市| 乐昌市| 无为县| 即墨市| 腾冲县| 安陆市| 成武县| 吉安县| 眉山市| 曲阜市| 惠来县| 道孚县| 刚察县|