Foxtable(狐表)用户栏目专家坐堂 → [求助]调用钉钉接口之后进程无法关闭


  共有5264人关注过本帖树形打印复制链接

主题:[求助]调用钉钉接口之后进程无法关闭

帅哥哟,离线,有人找我吗?
81538475
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
[求助]调用钉钉接口之后进程无法关闭  发帖心情 Post By:2022/12/21 18:44:00 [只看该作者]

try
    Dim client As DingTalk.Api.DefaultDingTalkClient = New DingTalk.Api.DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken")
    Dim request As DingTalk.Api.Request.OapiGettokenRequest = New DingTalk.Api.Request.OapiGettokenRequest()
    request.Appkey = "XXXXX"
    request.Appsecret = "XXXXXXXXX"
    request.SetHttpMethod("GET")
    Dim rsp As DingTalk.Api.Response.OapiGettokenResponse = client.Execute(request)
    Dim result As String = rsp.AccessToken
    Output.Show(result)
Catch ex As Exception
    
End Try

调用接口之后,关闭程序的话,会残留主程序,这种情况应该如何处理呢
图片点击可在新窗口打开查看

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/22 8:51:00 [只看该作者]

试试

try
    Dim client As DingTalk.Api.DefaultDingTalkClient = New DingTalk.Api.DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken")
    Dim request As DingTalk.Api.Request.OapiGettokenRequest = New DingTalk.Api.Request.OapiGettokenRequest()
    request.Appkey = "XXXXX"
    request.Appsecret = "XXXXXXXXX"
    request.SetHttpMethod("GET")
    Dim rsp As DingTalk.Api.Response.OapiGettokenResponse = client.Execute(request)
    Dim result As String = rsp.AccessToken
    Output.Show(result)
client =nothing
request=nothing
Catch ex As Exception

End Try

不行的话考虑到项目beforecloseproject事件用kill杀进程吧

 回到顶部
帅哥哟,离线,有人找我吗?
81538475
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:六尾狐 帖子:1302 积分:10502 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By:2022/12/22 11:53:00 [只看该作者]

杀自己的进程怎么写呢


 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:110574 积分:562760 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/12/22 12:03:00 [只看该作者]

Dim ps As  System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("某某进程名称")
For Each p As System.Diagnostics.Process In ps
    p.kill
Next

 回到顶部