以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  钉钉获取到的信息怎么写入表中  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=169995)

--  作者:cd_tdh
--  发布时间:2021/7/8 17:31:00
--  钉钉获取到的信息怎么写入表中

老师,从钉钉获取到的信息怎么写入表中,比如下面代码获取到的部门信息,怎么分行写入表中

Dim TX1 As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim TX2 As WinForm.TextBox = e.Form.Controls("TextBox2")
Dim access_token As String = Functions.Execute("access_token",TX1.TEXT,TX2.TEXT)

Dim client As DingTalk.Api.IDingTalkClient = New DingTalk.Api.DefaultDingTalkClient("https://oapi.dingtalk.com/department/list")
Dim req As DingTalk.Api.Request.OapiDepartmentListRequest = New DingTalk.Api.Request.OapiDepartmentListRequest()
req.SetHttpMethod("GET")
Dim rsp As DingTalk.Api.Response.OapiDepartmentListResponse = client.Execute(req, access_token)
Dim s As String
For i As Integer = 0 To rsp.Department.count -1
s+= rsp.Department.Item(I).name & vbCrLf
Next
MessageBox.Show(s)


--  作者:有点蓝
--  发布时间:2021/7/8 17:35:00
--  
不应该呀

dim r as row
For i As Integer = 0 To rsp.Department.count -1
r = tables("表A").addnew
r("部门") =  rsp.Department.Item(I).name
Next

--  作者:cd_tdh
--  发布时间:2021/7/8 17:40:00
--  
之前没弄过,才在论坛下载了一个示例,在学习中
--  作者:有点蓝
--  发布时间:2021/7/8 17:46:00
--  
这个功能和使用钉钉还是其它什么东西没有关系吧,不就是在循环里新增行赋值么。