Dim IPAdress As System.Net.IPAddress
Dim HostName As String
Dim nics() As System.Net.NetworkInformation.NetworkInterface = System.Net.NetworkInformation.NetworkInterface.GetAllNetworkInterfaces '定义MAC
Dim mac As String = nics(0).GetPhysicalAddress.Tostring '获得MAC地址
HostName = System.Net.Dns.GetHostName '获得本机的机器名
IPAdress = System.Net.Dns.GetHostByName(HostName).AddressList.GetValue(0) '获得本机的IP
FileSys.WriteAllText(ProjectPath & "Account.txt", s1, False, Encoding.Default) '写入当天日期
Dim hc As New HttpClient("http://139.17.186.23:3939/xtrzdjb.htm")
hc.FormData.Add("时间",Date.Now)
hc.FormData.Add("IP地址",IPAdress.ToString)
hc.FormData.Add("计算机名称",HostName)
hc.FormData.Add("MAC地址",mac)
hc.FormData.Add("机器码",ComputerId)
hc.FormData.Add("版本号",Tables("S_基础数据").Rows(2)("值"))
Dim ret As String = hc.getData()
以上代码有效,但是执行后会卡死1分钟,最后提示操作超时
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:
详细错误信息:
操作超时