Transfer from:
http://www.guoblog.com/blogview.asp?logid=202
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