From 49947e7f63c0ea1726261aed791203e89bdb2def Mon Sep 17 00:00:00 2001 From: tanghc Date: Fri, 21 Jun 2019 18:02:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sdk-csharp/SDKCSharp/Client/OpenClient.cs | 1 - .../SDKCSharp/Common/SopSignature.cs | 34 ------------------- sop-sdk/sdk-csharp/SDKCSharp/Program.cs | 7 +++- 3 files changed, 6 insertions(+), 36 deletions(-) delete mode 100644 sop-sdk/sdk-csharp/SDKCSharp/Common/SopSignature.cs diff --git a/sop-sdk/sdk-csharp/SDKCSharp/Client/OpenClient.cs b/sop-sdk/sdk-csharp/SDKCSharp/Client/OpenClient.cs index dd7e212a..fc6d2880 100644 --- a/sop-sdk/sdk-csharp/SDKCSharp/Client/OpenClient.cs +++ b/sop-sdk/sdk-csharp/SDKCSharp/Client/OpenClient.cs @@ -106,7 +106,6 @@ namespace SDKCSharp.Client form[this.openConfig.AccessTokenName] = accessToken; } form[this.openConfig.AppKeyName] = this.appId; - string content = SopSignature.getSignContent(form); string sign = SignUtil.CreateSign(form, privateKey, request.Charset, request.SignType); form[this.openConfig.SignName] = sign; diff --git a/sop-sdk/sdk-csharp/SDKCSharp/Common/SopSignature.cs b/sop-sdk/sdk-csharp/SDKCSharp/Common/SopSignature.cs deleted file mode 100644 index 207df76c..00000000 --- a/sop-sdk/sdk-csharp/SDKCSharp/Common/SopSignature.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; - -namespace SDKCSharp.Common -{ - public class SopSignature - { - public SopSignature() - { - } - - public static String getSignContent(Dictionary form) - { - StringBuilder content = new StringBuilder(); - List keys = new List(form.Keys); - - keys.Sort(); - int index = 0; - for (int i = 0; i < keys.Count; i++) - { - string key = keys[i]; - string value = form[key]; - if (!string.IsNullOrEmpty(key) && !string.IsNullOrEmpty(value)) - { - content.Append((index == 0 ? "" : "&") + key + "=" + value); - index++; - } - } - return content.ToString(); - } - } -} diff --git a/sop-sdk/sdk-csharp/SDKCSharp/Program.cs b/sop-sdk/sdk-csharp/SDKCSharp/Program.cs index d9ab9680..aee43161 100644 --- a/sop-sdk/sdk-csharp/SDKCSharp/Program.cs +++ b/sop-sdk/sdk-csharp/SDKCSharp/Program.cs @@ -29,7 +29,9 @@ namespace SDKTest public static void Main(string[] args) { TestGet(); + Console.WriteLine("--------------------"); TestCommon(); + Console.WriteLine("--------------------"); TestUpload(); } @@ -103,7 +105,10 @@ namespace SDKTest }; request.BizModel = model; - string root = Environment.CurrentDirectory; + string workDir = Environment.CurrentDirectory; + int index = workDir.LastIndexOf(@"/bin/Debug", StringComparison.Ordinal); + string root = workDir.Substring(0, index); + Console.WriteLine("当前目录{0}", root); // 文件上传