-
Notifications
You must be signed in to change notification settings - Fork 29
/
Default.aspx.cs
65 lines (54 loc) · 2.27 KB
/
Default.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Suite.Common;
using System.Configuration;
using Suite.API;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Json;
using Model;
namespace Suite
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
#region 获取套件配置参数
string m_Token = ConfigurationManager.AppSettings["Token"];
if (string.IsNullOrEmpty(m_Token))
Helper.WriteLog("token没有配置");
string m_SuiteKey = ConfigurationManager.AppSettings["SuiteKey"];
if (string.IsNullOrEmpty(m_Token))
Helper.WriteLog("token没有配置");
string m_EncodingAESKey = ConfigurationManager.AppSettings["EncodingAESKey"];
if (string.IsNullOrEmpty(m_Token))
Helper.WriteLog("token没有配置");
#endregion
//构造DingTalkCrypt
DingTalkCrypt dingTalk = new DingTalkCrypt(m_Token, m_EncodingAESKey, m_SuiteKey);
string sVerifyMsgSig = txtMsgSig.Text.Trim();
string sVerifyTimeStamp = txtTimeStamp.Text.Trim();
string sVerifyNonce = txtNonce.Text.Trim();
string encryptStr = txtEncryptStr.Text.Trim();
string sEchoStr = "";
int ret = dingTalk.VerifyURL(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, encryptStr, ref sEchoStr);
txtEchoStr.Text = sEchoStr;
//string sMsg = "";
//ret = dingTalk.DecryptMsg(sVerifyMsgSig, sVerifyTimeStamp, sVerifyNonce, encryptStr, ref sMsg);
//string sEncryptMsg = "";
//dingTalk.EncryptMsg("success", sVerifyTimeStamp, sVerifyNonce, ref sEncryptMsg);
// sVerifyTimeStamp = "1441713878094";
// sVerifyNonce = "ZjJmiMAu";
//dingTalk.EncryptMsg("success", sVerifyTimeStamp, sVerifyNonce, ref sEncryptMsg);
}
}
}