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
[C语言系列]NET 中C#的switch语句的语法 [系统软件]托拽Explore中的文件到VB.net的窗口 [系统软件]Boost库在XP+Visual C++.net中的安装 [常用软件]新配色面板:Paint.Net3.0RC1官方下载 [常用软件]解除上网限制 IP和MAC捆绑的破解方法 [常用软件]用内建的“Net Meeting”聊天 [VB.NET程序]Henry的VB.NET之旅(三)—共享成员 [VB.NET程序]Henry的VB.NET之旅(二)—构造与析构 [VB.NET程序]Henry的VB.NET之旅(一)—失踪的窗体 [VB.NET程序]在托盘上显示Balloon Tooltip(VB.NET)