自问自答一下:步骤1:完全按照楼主的方法,修改安装目录下的foxtable.exe.config,添加红色部分内容(黑色部分为原有内容)
<dependentAssembly>
<assemblyIdentity name="C1.C1Excel.4"
publicKeyToken="79882d576c6336da"
culture="neutral" />
<bindingRedirect oldVersion="4.0.20191.359" newVersion="4.0.20183.338" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="12.0.0.0" />
</dependentAssembly>
</assemblyBinding>
步骤2:
下载我提供的附件,只解压其中的Kingdee.BOS.WebApi.Client.dll,复制到foxtable安装目录,并且在项目中添加外部引用,选择该文件
步骤3:
如下代码,即可连接成功
Dim client As new Kingdee.BOS.WebApi.Client.K3CloudApiClient("http://金蝶服务器地址/k3cloud/")
Dim loginResult = client.ValidateLogin("账套ID","用户名","密码",2052)
Dim resultType As Integer = JObject.Parse(loginResult)("LoginResultType")
'登录结果类型等于1,代表登录成功
'If resultType = 1
'client.ExecuteBillQuery("{""FormId"":"""",""FieldKeys"":"""",""FilterString"":"""",""OrderString"":"""",""TopRowCount"":0,""StartRow"":0,""Limit"":0}")
'End If
Output.Show(resultType)
Output.Show(loginResult)
[此贴子已经被作者于2022/3/22 18:02:05编辑过]