国产探花免费观看_亚洲丰满少妇自慰呻吟_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
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 通河县| 洪雅县| 乌恰县| 清镇市| 灌云县| 洛扎县| 博兴县| 苏尼特右旗| 庆元县| 汉源县| 通渭县| 七台河市| 柳江县| 都安| 甘德县| 文昌市| 清流县| 苏尼特右旗| 关岭| 瑞金市| 华池县| 陆河县| 张家川| 富川| 堆龙德庆县| 化州市| 台北市| 潞城市| 东平县| 石首市| 广元市| 梅河口市| 三门峡市| 韶山市| 雷波县| 宝丰县| 库尔勒市| 砀山县| 恩施市| 枣庄市| 西峡县|