Dim HostName As String HostName = System.Net.Dns.GetHostName '获得本机的机器名 Dim dr As DataRow dr = DataTables("登录").Find("[Name] = '" & HostName & "'") msgbox("[Name] = '" & HostName & "'") msgbox(dr Is Nothing) If dr IsNot Nothing Then Output.Show("找到了") ' 启动扫描仪 Else Output.Show("没有找到") End If