删除无用代码

1.x
tanghc 6 years ago
parent e40ab63f1f
commit 49947e7f63
  1. 1
      sop-sdk/sdk-csharp/SDKCSharp/Client/OpenClient.cs
  2. 34
      sop-sdk/sdk-csharp/SDKCSharp/Common/SopSignature.cs
  3. 7
      sop-sdk/sdk-csharp/SDKCSharp/Program.cs

@ -106,7 +106,6 @@ namespace SDKCSharp.Client
form[this.openConfig.AccessTokenName] = accessToken; form[this.openConfig.AccessTokenName] = accessToken;
} }
form[this.openConfig.AppKeyName] = this.appId; form[this.openConfig.AppKeyName] = this.appId;
string content = SopSignature.getSignContent(form);
string sign = SignUtil.CreateSign(form, privateKey, request.Charset, request.SignType); string sign = SignUtil.CreateSign(form, privateKey, request.Charset, request.SignType);
form[this.openConfig.SignName] = sign; form[this.openConfig.SignName] = sign;

@ -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<string, string> form)
{
StringBuilder content = new StringBuilder();
List<string> keys = new List<string>(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();
}
}
}

@ -29,7 +29,9 @@ namespace SDKTest
public static void Main(string[] args) public static void Main(string[] args)
{ {
TestGet(); TestGet();
Console.WriteLine("--------------------");
TestCommon(); TestCommon();
Console.WriteLine("--------------------");
TestUpload(); TestUpload();
} }
@ -103,7 +105,10 @@ namespace SDKTest
}; };
request.BizModel = model; 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); Console.WriteLine("当前目录{0}", root);
// 文件上传 // 文件上传

Loading…
Cancel
Save