'电脑ip设置 Dim IPAdress As System.Net.IPAddress Dim HostName As String HostName = System.Net.Dns.GetHostName '获得本机的机器名 IPAdress = System.Net.Dns.GetHostByName(HostName).AddressList.GetValue(0) '获得本机的IP Dim ip As String = IPAdress.ToString Dim dt As DataTable = DataTables("电脑位置") Dim dr As DataRow dr = dt.Find("电脑位置 = '" & IP & "' ") If dr Is Nothing Then MessageBox.show("你的电脑不存在!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information) Syscmd.Project.Exit(False) Else If dr.IsNull("用户") = False Then Dim nms() As String = dr("用户").Split(",") For Each nm As String In nms If NM<>user.name AndAlso User.Type <> UserTypeEnum.Developer AndAlso User.Type <> UserTypeEnum.Administrator Then MessageBox.Show("您未获得该电脑授权,无法使用该软件!!1") Syscmd.Project.Exit(False) End If Next End If End If
|