大神帮忙接口对接,谢谢了
[此贴子已经被作者于2023/8/16 14:01:45编辑过]
Dim hc As New HttpClient("http://jgptzw.dcyun.com:49000/ProjectSuperviseService.asmx/ReceiveJson")
hc.ContentType = "application/x-www-form-urlencoded;charset=UTF-8"
hc.Headers.Add("UserName","xxxUserName")
hc.Headers.Add("Token","xxxToken")
hc.FormData.Add("strCommand","xxx类型")
hc.FormData.Add("strContent","xxx内容")
Dim ret As String = hc.getData()
output.show(ret)
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:窗口,上报,上报,Click
详细错误信息:
无法将类型为“System.String”的对象强制转换为类型“Newtonsoft.Json.Linq.JToken”。
Dim Proc As New Process
Proc.Arguments = Tables("tabl").Current("项目资料") '打开
Proc.Start()
执行上面代码,出现下面错误
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:
详细错误信息:
尚未提供文件名,因此无法启动进程。
if Tables("tabl").Current isnot nothing
msgbox(Tables("tabl").Current("项目资料"))
Dim Proc As New Process
Proc.File = Tables("tabl").Current("项目资料") '打开
Proc.Start()
endif
access数据库
cmd.Com mandText = "se lect * from {xjbb} where [年份] = #" & Date.Today.Year & "# And [未到金额] > '0'"
.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2022.1.30.2
错误所在事件:
详细错误信息:
字符串的语法错误 在查询表达式 '[年份] = #2022# and [未到金额] > '0' 中。
日期列才能使用#,多看几遍:
http://www.foxtable.com/webhelp/topics/1284.htm
cmd.Com mandText = "se lect * from {xjbb} where [年份] = " & Date.Today.Year & " And [未到金额] > 0"
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
错误所在事件:
详细错误信息:
操作超时