钉钉SDK使用。

(1)到 https://open-doc.dingtalk.com/microapp/faquestions/vzbp02 下载SDK

(2)引入

using DingTalk.Api;
using DingTalk.Api.Request;
using DingTalk.Api.Response;

  

(3)获取AccessToken

   string appkey = "dingt1s1h82ctf6wyy11";
        string appSec = "NKfjZJrNlZUIhcJPVURipXi9V6cduQcc5T5hBEJu5pyrWi7yCOVMGILtq6ELqU11";

        IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");

        OapiGettokenRequest req=new OapiGettokenRequest();

      
        req.Appsecret = appSec;
        req.Appkey = appkey;
        req.SetHttpMethod("GET");
     
        OapiGettokenResponse res = null;
        res = client.Execute(req);
        
        Response.Write(res.AccessToken);
       

  

 

DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1));
DateTime dtNow = DateTime.Parse("2019-7-31 ");
TimeSpan toNow = dtNow.Subtract(dtStart);
string timeStamp = toNow.Ticks.ToString();
timeStamp = timeStamp.Substring(0,timeStamp.Length - 7);
Response.Write(timeStamp);

posted @ 2019-07-29 14:57  启明星工作室  阅读(2674)  评论(0编辑  收藏  举报