Commit 057ed2dc by mahaisong

fix:GHHttpClient.csproj 已经封装完毕。

实现功能: 1.HttpWebRequest改为4.6.1的HttpClient用法。 2.HttpClient做成公用预热长连接,节省TCP握手。 3.对于个别Timer获取不到TOKEN的逻辑进行补充,做了多线程的阻塞和同步机制。 4.接口从JOBJECT 改为 DIC。类内部做了封装。 5.通过配置文件读取配置。开放Token校验函数。
parent 354efbc4
using System;
using System;
namespace GHHttpClient
{
public class Class1
{
}
}
using System;
using System;
namespace GHHttpClient
{
public class Class1
{
}
}
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net45;net46;net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net45;net46;net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
</PropertyGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">net45;net46;net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
</PropertyGroup>
</Project>
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyTitleAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyTitleAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
4957e125e53707b1f892b4bb9d9dae27b7dabc9d
4957e125e53707b1f892b4bb9d9dae27b7dabc9d
4957e125e53707b1f892b4bb9d9dae27b7dabc9d
4957e125e53707b1f892b4bb9d9dae27b7dabc9d
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92(2).cs"
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs"
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1(2).cs"
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs"
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3(2).cs"
++ "b/14.java\350\275\254C#/TestC/Backup/obj/Debug/net45/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs"
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyTitleAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyTitleAttribute("GHHttpClient")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
e94233612123dc19e4eb14d4c5fe3115252e5def
f4f84d0f7b9be806e309cf4b836ae6730b568570
f4f84d0f7b9be806e309cf4b836ae6730b568570
f4f84d0f7b9be806e309cf4b836ae6730b568570
f4f84d0f7b9be806e309cf4b836ae6730b568570
{
{
"version": 1,
"dgSpecHash": "off1dTzfQ/RYdzCX7TirhXM9T/GdWzXalE7k/SchiFtyPRpcOcxvTH/IgtxFPkRA4OtfCcShTZ/I5Jq80npXAw==",
"success": true
}
\ No newline at end of file
{
{
"version": 1,
"dgSpecHash": "off1dTzfQ/RYdzCX7TirhXM9T/GdWzXalE7k/SchiFtyPRpcOcxvTH/IgtxFPkRA4OtfCcShTZ/I5Jq80npXAw==",
"success": true
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.7.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.7.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
</Project>
\ No newline at end of file
{
{
"version": 3,
"targets": {
".NETFramework,Version=v4.5": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.5": []
},
"packageFolders": {
"C:\\Users\\admin\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\GHHttpClient.csproj",
"projectName": "GHHttpClient",
"projectPath": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\GHHttpClient.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net45",
"net46",
"net461",
"netstandard2.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cdn.azure.cn/v3/index.json": {},
"https://www.nuget.org/api/v2/": {}
},
"frameworks": {
"net45": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net45": {}
}
}
}
\ No newline at end of file
{
{
"version": 3,
"targets": {
".NETFramework,Version=v4.5": {}
},
"libraries": {},
"projectFileDependencyGroups": {
".NETFramework,Version=v4.5": []
},
"packageFolders": {
"C:\\Users\\admin\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\GHHttpClient.csproj",
"projectName": "GHHttpClient",
"projectPath": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\GHHttpClient.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\smallproject\\14.java转C#\\TestC\\GHHttpClient\\obj\\",
"projectStyle": "PackageReference",
"crossTargeting": true,
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net45",
"net46",
"net461",
"netstandard2.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cdn.azure.cn/v3/index.json": {},
"https://www.nuget.org/api/v2/": {}
},
"frameworks": {
"net45": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net45": {}
}
}
}
\ No newline at end of file
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GHHttpClient
{
internal class ConnectionOptions
{
private readonly string _usersConnectionString;
private readonly Dictionary<string, string> _parsetable = new Dictionary<string, string>();
internal readonly NameValuePair KeyChain;
internal ConnectionOptions()
{
}
internal ConnectionOptions(string connectionString, IList<string> validKeywords)
{
_usersConnectionString = connectionString ?? "";
// 解析、初始语法检查
if (0 < _usersConnectionString.Length)
{
KeyChain = ParseInternal(_parsetable, _usersConnectionString, validKeywords);
}
}
internal string UsersConnectionString
{
get { return _usersConnectionString ?? string.Empty; }
}
internal bool IsEmpty
{
get { return (null == KeyChain); }
}
//解析表
internal Dictionary<string, string> Parsetable
{
get { return _parsetable; }
}
internal virtual string this[string keyword, string defaultvalue=null]
{
get
{
string value;
if (_parsetable.TryGetValue(keyword, out value))
{
return value;
}
return defaultvalue;
}
}
//[SuppressMessage("Microsoft.Globalization", "CA1308:NormalizeStringsToUppercase")]
private static string GetKeyName(StringBuilder buffer)
{
var count = buffer.Length;
while ((0 < count)
&& Char.IsWhiteSpace(buffer[count - 1]))
{
count--; //尾部空格
}
return buffer.ToString(0, count).ToLowerInvariant();
}
private static string GetKeyValue(StringBuilder buffer, bool trimWhitespace)
{
var count = buffer.Length;
var index = 0;
if (trimWhitespace)
{
while ((index < count)
&& Char.IsWhiteSpace(buffer[index]))
{
index++; //头部空格
}
while ((0 < count)
&& Char.IsWhiteSpace(buffer[count - 1]))
{
count--; //尾部空格
}
}
return buffer.ToString(index, count - index);
}
// 用于解析的传递状态
private enum ParserState
{
NothingYet = 1, //开始指针
Key,
KeyEqual,
KeyEnd,
UnquotedValue,
DoubleQuoteValue,
DoubleQuoteValueQuote,
SingleQuoteValue,
SingleQuoteValueQuote,
QuotedValueEnd,
NullTermination,
};
//[SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
private static int GetKeyValuePair(
string connectionString, int currentPosition, StringBuilder buffer, out string keyname, out string keyvalue)
{
var startposition = currentPosition;
buffer.Length = 0;
keyname = null;
keyvalue = null;
var currentChar = '\0';
var parserState = ParserState.NothingYet;
var length = connectionString.Length;
for (; currentPosition < length; ++currentPosition)
{
currentChar = connectionString[currentPosition];
switch (parserState)
{
case ParserState.NothingYet: // [\\s;]*
if ((';' == currentChar)
|| Char.IsWhiteSpace(currentChar))
{
continue;
}
if ('\0' == currentChar)
{
parserState = ParserState.NullTermination;
continue;
}
if (Char.IsControl(currentChar))
{
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
}
startposition = currentPosition;
if ('=' != currentChar)
{
parserState = ParserState.Key;
break;
}
else
{
parserState = ParserState.KeyEqual;
continue;
}
case ParserState.Key: // (?<key>([^=\\s\\p{Cc}]|\\s+[^=\\s\\p{Cc}]|\\s+==|==)+)
if ('=' == currentChar)
{
parserState = ParserState.KeyEqual;
continue;
}
if (Char.IsWhiteSpace(currentChar))
{
break;
}
if (Char.IsControl(currentChar))
{
throw new ArgumentException("链接字符串在:"+startposition+"位置,报错");
}
break;
case ParserState.KeyEqual: // \\s*=(?!=)\\s*
if ('=' == currentChar)
{
parserState = ParserState.Key;
break;
}
keyname = GetKeyName(buffer);
if (string.IsNullOrEmpty(keyname))
{
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
}
buffer.Length = 0;
parserState = ParserState.KeyEnd;
goto case ParserState.KeyEnd;
case ParserState.KeyEnd:
if (Char.IsWhiteSpace(currentChar))
{
continue;
}
if ('\'' == currentChar)
{
parserState = ParserState.SingleQuoteValue;
continue;
}
if ('"' == currentChar)
{
parserState = ParserState.DoubleQuoteValue;
continue;
}
if (';' == currentChar)
{
goto ParserExit;
}
if ('\0' == currentChar)
{
goto ParserExit;
}
if (Char.IsControl(currentChar))
{
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
}
parserState = ParserState.UnquotedValue;
break;
case ParserState.UnquotedValue: // "((?![\"'\\s])" + "([^;\\s\\p{Cc}]|\\s+[^;\\s\\p{Cc}])*" + "(?<![\"']))"
if (Char.IsWhiteSpace(currentChar))
{
break;
}
if (Char.IsControl(currentChar)
|| ';' == currentChar)
{
goto ParserExit;
}
break;
case ParserState.DoubleQuoteValue: // "(\"([^\"\u0000]|\"\")*\")"
if ('"' == currentChar)
{
parserState = ParserState.DoubleQuoteValueQuote;
continue;
}
if ('\0' == currentChar)
{
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
}
break;
case ParserState.DoubleQuoteValueQuote:
if ('"' == currentChar)
{
parserState = ParserState.DoubleQuoteValue;
break;
}
keyvalue = GetKeyValue(buffer, false);
parserState = ParserState.QuotedValueEnd;
goto case ParserState.QuotedValueEnd;
case ParserState.SingleQuoteValue: // "('([^'\u0000]|'')*')"
if ('\'' == currentChar)
{
parserState = ParserState.SingleQuoteValueQuote;
continue;
}
if ('\0' == currentChar)
{
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
}
break;
case ParserState.SingleQuoteValueQuote:
if ('\'' == currentChar)
{
parserState = ParserState.SingleQuoteValue;
break;
}
keyvalue = GetKeyValue(buffer, false);
parserState = ParserState.QuotedValueEnd;
goto case ParserState.QuotedValueEnd;
case ParserState.QuotedValueEnd:
if (Char.IsWhiteSpace(currentChar))
{
continue;
}
if (';' == currentChar)
{
goto ParserExit;
}
if ('\0' == currentChar)
{
parserState = ParserState.NullTermination;
continue;
}
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错"); // unbalanced single quote
case ParserState.NullTermination: // [\\s;\u0000]*
if ('\0' == currentChar)
{
continue;
}
if (Char.IsWhiteSpace(currentChar))
{
continue;
}
throw new ArgumentException("链接字符串在:" + startposition + "位置,报错");
default:
throw new InvalidOperationException("链接字符串在:" + startposition + "位置,报错");
}
buffer.Append(currentChar);
}
ParserExit:
switch (parserState)
{
case ParserState.Key:
case ParserState.DoubleQuoteValue:
case ParserState.SingleQuoteValue:
throw new ArgumentException("链接字符串在:"+startposition+"位置,报错");
case ParserState.KeyEqual:
keyname = GetKeyName(buffer);
if (string.IsNullOrEmpty(keyname))
{
throw new ArgumentException("链接字符串在:"+startposition+"位置,报错");
}
break;
case ParserState.UnquotedValue:
keyvalue = GetKeyValue(buffer, true);
var tmpChar = keyvalue[keyvalue.Length - 1];
if (('\'' == tmpChar)
|| ('"' == tmpChar))
{
throw new ArgumentException("链接字符串在:"+startposition+"位置,报错");
}
break;
case ParserState.DoubleQuoteValueQuote:
case ParserState.SingleQuoteValueQuote:
case ParserState.QuotedValueEnd:
keyvalue = GetKeyValue(buffer, false);
break;
case ParserState.NothingYet:
case ParserState.KeyEnd:
case ParserState.NullTermination:
break;
default:
throw new InvalidOperationException(
"链接字符串在:" + startposition + "位置,报错");
}
if ((';' == currentChar)
&& (currentPosition < connectionString.Length))
{
currentPosition++;
}
return currentPosition;
}
private static NameValuePair ParseInternal(IDictionary<string, string> parsetable, string connectionString, IList<string> validKeywords)
{
var buffer = new StringBuilder();
NameValuePair localKeychain = null, keychain = null;
var nextStartPosition = 0;
var endPosition = connectionString.Length;
while (nextStartPosition < endPosition)
{
var startPosition = nextStartPosition;
string keyname, keyvalue;
nextStartPosition = GetKeyValuePair(connectionString, startPosition, buffer, out keyname, out keyvalue);
if (string.IsNullOrEmpty(keyname))
{
break;
}
if (!validKeywords.Contains(keyname))
{
throw new ArgumentException("字符串中KEY:" + keyname + "报错");
}
parsetable[keyname] = keyvalue; // 最后一个键值对获胜(或第一个)
if (null != localKeychain)
{
localKeychain = localKeychain.Next = new NameValuePair();
}
else
{
keychain = localKeychain = new NameValuePair();
}
}
return keychain;
}
}
internal sealed class NameValuePair
{
private NameValuePair _next;
internal NameValuePair Next
{
get { return _next; }
set
{
if ((null != _next)
|| (null == value))
{
throw new InvalidOperationException("");
}
_next = value;
}
}
}
}
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.X509;
using System.Security.Cryptography;
using Org.BouncyCastle.Security;
using Org.BouncyCastle.Math;
using System.Security.Cryptography.X509Certificates;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Crypto.Encodings;
using Org.BouncyCastle.Crypto.Engines;
namespace GHHttpClient
{
//基本步骤:1.初始化证书为公钥。
// 2.对公钥进行RSA加密。(包括对数据加密)
// 3.对私钥解密。(用RSA签名验证签名)
public class CryptoUtil
{
private static AsymmetricKeyParameter publickKey;
private static long privateKey;
private static String _certPath;
private static String _certificateFileName;
private static String _certXmlPath;
private static String _certXmlString;
//初始化公钥对象
public static void initEncrypto(String certificateFile)
{
//使用证书类,得到证书类型实例,同时指定证书文件地址,文件流形式加载证书, 得到公钥对象(问题2:需要搞明白C#的CertificateFactory和PublicKey类型)
_certPath = System.AppDomain.CurrentDomain.BaseDirectory + "\\" + certificateFile; //证书已上传到对应目录
FileInfo crt = new FileInfo(_certPath);
if (!crt.Exists)
{
//文件不存在
}
_certificateFileName = Path.GetFileNameWithoutExtension(_certPath);
_certXmlPath = crt.DirectoryName + "\\" + _certificateFileName + ".xml"; //XML证书
var bytes = default(byte[]);
using (var sr = new StreamReader(_certPath))
{
using (var memstream = new MemoryStream())
{
sr.BaseStream.CopyTo(memstream);
bytes = memstream.ToArray();
}
//重大的坑 NET: X509Certificate 不支持PublicKey,与java的key无法共用
// NET: X509Certificate2 支持PublicKey,但RSA有问题:该项不适于在指定状态下使用。同时与java的key无法共用。
//改为 BouncyCastle 与java的key共用
//X509Certificate2 x5092 = new X509Certificate2(bytes);
//publickKey = x5092.PublicKey;
Org.BouncyCastle.X509.X509Certificate x509 = new X509CertificateParser().ReadCertificate(bytes);
publickKey = x509.GetPublicKey();
//转换成XML
try
{
RsaKeyParameters publicKeyParam = (RsaKeyParameters)publickKey;
_certXmlString = string.Format(
"<RSAKeyValue>" +
"<Modulus>{0}</Modulus>" +
"<Exponent>{1}</Exponent>" +
"</RSAKeyValue>",
Convert.ToBase64String(publicKeyParam.Modulus.ToByteArrayUnsigned()),
Convert.ToBase64String(publicKeyParam.Exponent.ToByteArrayUnsigned()));
using (var sw = new StreamWriter(_certXmlPath))
{
sw.Write(_certXmlString);
}
//测试:创建RSA对象并载入[公钥]
//RSACryptoServiceProvider publicRsa = new RSACryptoServiceProvider();
//publicRsa.FromXmlString(_certXmlString);
}
catch (Exception ex)
{
}
}
}
/// <summary>用公钥给数据进行RSA加密
/// </summary>
/// <param name="xmlPublicKey">公钥</param>
/// <param name="m_strEncryptString">待加密数据</param>
/// <returns>加密后的数据(Base64)</returns>
public static string RSAEncryptByPublicKey(string strEncryptString = null)
{
try
{
byte[] DataToEncrypt = Encoding.UTF8.GetBytes(strEncryptString);
byte[] outBytes = null;
//两种方式:
//1.NET
//IAsymmetricBlockCipher signer = new Pkcs1Encoding(new RsaEngine());
//signer.Init(true, publickKey);
//try
//{
// outBytes = signer.ProcessBlock(DataToEncrypt, 0, DataToEncrypt.Length);
//}
//catch (Exception e)
//{
// //Fail("RSA: failed - exception " + e.ToString(), e);
//}
//outBytes = signer.ProcessBlock.DoFinal(DataToEncrypt);//加密
//2.仿照JAVA
IBufferedCipher c = CipherUtilities.GetCipher("RSA/ECB/PKCS1PADDING");
//参数与Java中加密解密的参数一致
RsaKeyParameters publicKeyParam = (RsaKeyParameters)publickKey;
//第一个参数为true表示加密,为false表示解密;第二个参数表示密钥
c.Init(true, publickKey);
outBytes = c.DoFinal(DataToEncrypt);//加密
string strBase64 = Convert.ToBase64String(outBytes);
return strBase64;
}
catch (Exception ex)
{
return null;
}
}
public static void initDecrypto(String keystoreFile, String keystorePass, String keyPass)
{
//KeyStore ks = KeyStore.getInstance("JKS");
//ks.load(new FileInputStream(keystoreFile), keystorePass.toCharArray());
//privateKey = ks.getKey("mykey", keyPass.toCharArray());
}
//public static byte[] decrypto(byte[] data)
//{
//try
//{
// Cipher cipher = Cipher.getInstance("RSA");
// cipher.init(2, privateKey);
// return cipher.doFinal(data);
//}
//catch (Exception e)
//{
// e.printStackTrace();
//}
//throw new ESBFinderException("解密数据失败");
//}
#region 导出公钥为PEMcrt后缀的文件
public static String ExportPublicKeyToPEMFormat(RSACryptoServiceProvider csp)
{
TextWriter outputStream = new StringWriter();
var parameters = csp.ExportParameters(false);
using (var stream = new MemoryStream())
{
var writer = new BinaryWriter(stream);
writer.Write((byte)0x30); // SEQUENCE
using (var innerStream = new MemoryStream())
{
var innerWriter = new BinaryWriter(innerStream);
EncodeIntegerBigEndian(innerWriter, new byte[] { 0x00 }); // Version
EncodeIntegerBigEndian(innerWriter, parameters.Modulus);
EncodeIntegerBigEndian(innerWriter, parameters.Exponent);
//All Parameter Must Have Value so Set Other Parameter Value Whit Invalid Data (for keeping Key Structure use "parameters.Exponent" value for invalid data)
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.D
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.P
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.Q
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.DP
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.DQ
EncodeIntegerBigEndian(innerWriter, parameters.Exponent); // instead of parameters.InverseQ
var length = (int)innerStream.Length;
EncodeLength(writer, length);
writer.Write(innerStream.GetBuffer(), 0, length);
}
var base64 = Convert.ToBase64String(stream.GetBuffer(), 0, (int)stream.Length).ToCharArray();
outputStream.WriteLine("-----BEGIN PUBLIC KEY-----");
// Output as Base64 with lines chopped at 64 characters
for (var i = 0; i < base64.Length; i += 64)
{
outputStream.WriteLine(base64, i, Math.Min(64, base64.Length - i));
}
outputStream.WriteLine("-----END PUBLIC KEY-----");
return outputStream.ToString();
}
}
private static void EncodeIntegerBigEndian(BinaryWriter stream, byte[] value, bool forceUnsigned = true)
{
stream.Write((byte)0x02); // INTEGER
var prefixZeros = 0;
for (var i = 0; i < value.Length; i++)
{
if (value[i] != 0) break;
prefixZeros++;
}
if (value.Length - prefixZeros == 0)
{
EncodeLength(stream, 1);
stream.Write((byte)0);
}
else
{
if (forceUnsigned && value[prefixZeros] > 0x7f)
{
// Add a prefix zero to force unsigned if the MSB is 1
EncodeLength(stream, value.Length - prefixZeros + 1);
stream.Write((byte)0);
}
else
{
EncodeLength(stream, value.Length - prefixZeros);
}
for (var i = prefixZeros; i < value.Length; i++)
{
stream.Write(value[i]);
}
}
}
private static void EncodeLength(BinaryWriter stream, int length)
{
if (length < 0) throw new ArgumentOutOfRangeException("length", "Length must be non-negative");
if (length < 0x80)
{
// Short form
stream.Write((byte)length);
}
else
{
// Long form
var temp = length;
var bytesRequired = 0;
while (temp > 0)
{
temp >>= 8;
bytesRequired++;
}
stream.Write((byte)(bytesRequired | 0x80));
for (var i = bytesRequired - 1; i >= 0; i--)
{
stream.Write((byte)(length >> (8 * i) & 0xff));
}
}
}
#endregion
}
}
using Newtonsoft.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Security;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Timers;
namespace GHHttpClient
{
/// <summary>
/// 注意:单例模式只支持1个appid。
/// </summary>
public class ESBFinder
{
//静态化,公用同一个Tcp链接,减少重建握手环节,不再销毁
protected static HttpClient http;
protected static HttpClientHandler handler;
#region 单例模式+构造函数
private static object _instanceLock = new object();
private static ESBFinder _instance;
/// <summary>
/// HTTP实例
/// </summary>
public static ESBFinder Instance
{
get
{
if (_instance == null)
{
lock (_instanceLock)
{
if (_instance == null)
{
_instance = new ESBFinder();
}
}
}
return _instance;
}
}
/// <summary>
/// 指定链接字符串GH_ESBFinder
/// </summary>
/// <remarks>证书必须在程序运行目录根目录</remarks>
private ESBFinder()
{
//加载APPCONFIG配置
var setting = ConfigurationManager.ConnectionStrings["GH_ESBFinder"];
ConnectionOptions ConnectOptions = new ConnectionOptions(setting.ConnectionString, ValidKeywords);
AppId = ConnectOptions[V_AppId, "Mys77mkOyevOXMx0"];
string SecretMD5 = ConnectOptions[V_Secret, "f00f8f8ea15e5d314d4ccb419c2e176d"];
Enpoint = ConnectOptions[V_Enpoint, "http://113.16.174.140:8024/finder"];
Certificate = ConnectOptions[V_Certificate, "ESBFinder_SDK.crt"];
//MD5加密
MD5 md5 = new MD5CryptoServiceProvider();
byte[] tempbytes = md5.ComputeHash(UnicodeEncoding.UTF8.GetBytes(SecretMD5));
//HEX:java要求16进制小写,1个字节2个16进制字符
string hexString = "";
for (int i = 0; i < tempbytes.Length; i++)
{
hexString += tempbytes[i].ToString("x2");
}
Secret = hexString;//密钥 按照约定好的方式加密一下。
//加载公钥
try
{
CryptoUtil.initEncrypto(Certificate);
}
catch (Exception e)
{
//"SDK证书错误、SDK证书文件不存: " + publicKeyFile);
}
//开启周期性-token自动刷新
//this.tokenTimer = new Timer();
//截止到此,密钥加密了,公钥加载好了。
try
{
handler = new HttpClientHandler()
{
CookieContainer = new CookieContainer(),
UseCookies = true,
AutomaticDecompression = DecompressionMethods.GZip
};
http = new HttpClient(handler)
{
BaseAddress = new Uri(Enpoint),
Timeout = new TimeSpan(0, 0, 40)
};
//保持长连接
http.DefaultRequestHeaders.Connection.Add("keep-alive");
}
catch (Exception ex)
{
//http失效
throw;
}
//加载Token HttpClient预热
authAndGetToken();
}
#endregion
#region 属性
//----检查特殊过期
//TokenTimer刷新出现问题时阻塞一下。刷新后同时通知多个线程。
private static ManualResetEvent mReset = new ManualResetEvent(false);
private static object _mResetLock = new object();
private static bool _mResetLocked = true;
private String AppId; // APPID
private String Secret; // APP密钥串
private String Enpoint; // 服务器地址,请根据实际情况修改
private String Certificate; // 公钥证书文件,例如"ESBFinder_SDK.crt":证书必须在程序运行目录根目录
private String SecretToken;
private long TokenValidity;//秒(通用为7200秒,2小时)
private System.Timers.Timer TokenTimer = null;
private long LastTokenTimestamp;
private bool isAccessTokenSet = false;//是否已经加载Token成功
public String GetSecretToken()
{
return this.SecretToken;
}
/// <summary>
/// Token还剩多少秒过期
/// </summary>
/// <returns></returns>
public long GetTokenValidity()
{
//注意;TICK的单位是100毫微秒
return this.TokenValidity - (DateTime.Now.Ticks - this.LastTokenTimestamp) / 10000000L;
}
/// <summary>
/// Token是否有效。
/// </summary>
/// <remarks> Token小于60秒时被验证为过期。(原因是Timer到期300秒之前就已经刷新了一次,永远不会小于300(-访问耗时,约200),如果小于60则证明Timer刷新失败了,需要重新刷新)</remarks>
public bool IsAuthorized
{
get { return isAccessTokenSet && !string.IsNullOrEmpty(SecretToken) && (GetTokenValidity() > 60L); }
}
#region 得到APP.Config
private const String V_AppId = "appid"; // APPID
private const String V_Secret = "secret"; // APP密钥串
private const String V_Enpoint = "enpoint"; // 服务器地址,请根据实际情况修改
private const String V_Certificate = "crt"; // 公钥证书文件,例如"ESBFinder_SDK.crt":证书必须在程序运行目录根目录
internal static readonly string[] ValidKeywords = new[]
{
V_AppId,
V_Secret,
V_Enpoint,
V_Certificate
};
#endregion
#endregion
#region 刷新Token
//Methods
private static bool CheckValidationResult(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors) =>
true;
/// <summary>
/// 初始化得到Token
/// </summary>
private void authAndGetToken()
{
int tryCount = 0;
GetTokenNoResponse:
try
{
JObject credential = new JObject();
credential["id"] = this.AppId;
credential["secret"] = this.Secret;//密钥
//将公钥、数据(json对象,appid和加密后的密钥)按照RSA方式加密
//将data按照Base64编码,以HTTP的形式post(内部代码只是UTF-8了一下,头部没加内容,返回值得到content)
string jsonbody = CryptoUtil.RSAEncryptByPublicKey(JsonConvert.SerializeObject(credential));
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CheckValidationResult);
HttpResponseMessage response = HttpPostAsync(this.Enpoint + "/auth", jsonbody).Result;
//解析成json对象
if (response != null && response.StatusCode == System.Net.HttpStatusCode.OK)
{
JObject ret = JObject.Parse(response.Content.ReadAsStringAsync().Result);
//得到新token
this.SecretToken = ((String)ret["token"]);
//if (this.secretToken == null)
// "AppID未授权或密钥错误");
//过期时间
this.TokenValidity = long.Parse(ret["validity"].ToString());
//最近一次token时间---后面会根据过期时间,再次刷新token
this.LastTokenTimestamp = DateTime.Now.Ticks;
//激活周期性调度
scheuleRefreshToken();
tryCount = 0;
}
else
{
if (tryCount < 3)
{
tryCount = tryCount + 1;
goto GetTokenNoResponse;
}
}
}
catch (Exception)
{
if (tryCount < 3)
{
tryCount = tryCount + 1;
goto GetTokenNoResponse;
}
throw;
}
#region 版本1
//HttpWebRequest request = WebRequest.Create(this.Enpoint + "/auth") as HttpWebRequest;
//request.ProtocolVersion = HttpVersion.Version10;
//request.Method = "POST";
//request.ContentType = "application/x-www-form-urlencoded";
//try
//{
// //初始化
// //byte[] data = default(byte[]);
// //request.ContentType = "application/json";
// using (Stream stream = request.GetRequestStream())
// {
// byte[] data = System.Text.Encoding.UTF8.GetBytes(jsonbody);
// stream.Write(data, 0, data.Length);
// }
// System.Net.HttpWebResponse publicresponse = (request.GetResponse() as HttpWebResponse);
// StreamReader publicsr = new StreamReader(publicresponse.GetResponseStream(), Encoding.UTF8);
// String resp = publicsr.ReadToEnd();
// if (resp != null)
// {
// //解析成json对象
// JObject ret = JObject.Parse(resp);
// //得到新token
// this.SecretToken = ((String)ret["token"]);
// //if (this.secretToken == null)
// // "AppID未授权或密钥错误");
// //过期时间
// this.TokenValidity = long.Parse(ret["validity"].ToString());
// //最近一次token时间---后面会根据过期时间,再次刷新token
// this.LastTokenTimestamp = DateTime.Now.Ticks;
// //激活周期性调度
// scheuleRefreshToken();
// }
//}
//catch (Exception ex)
//{
// throw;
//}
#endregion
this.isAccessTokenSet = true;
//接收到正确的Token,唤起阻塞线程。
mReset.Set();//大门打开
_mResetLocked = false;
}
//周期性刷新token,检查timer过期,启动run,执行authAndGetToken,刷新token
private void scheuleRefreshToken()
{
try
{
TokenTimer.Enabled = false;
TokenTimer.Stop();
TokenTimer = null;
}
catch { TokenTimer = null; }
//建立timer
TokenTimer = new System.Timers.Timer();
TokenTimer.Interval = (this.TokenValidity - 300L) * 1000L;//下一次过期时间之前300秒刷新一下。
TokenTimer.AutoReset = true;
TokenTimer.Enabled = true;
TokenTimer.Elapsed += TokenTimer_Elapsed;
}
private void TokenTimer_Elapsed(object sender, ElapsedEventArgs e)
{
try
{
authAndGetToken();
}
catch (Exception ex)
{
//e.printStackTrace();
}
}
#endregion
//外部调用发送post请求,自动封装token,(注意参数cmd、param、路径api、secretToken,这写法都是约定好的)
public string sendRequest(String cmd, Dictionary<string, object> parameters)
{
string result = String.Empty;
int tryCount = 0;
GetRequestNoResponse:
try
{
#region 检查特殊过期 --过期阻塞等待刷新。
if (!IsAuthorized)
{
if (!_mResetLocked)
{
//第一次时Reset,非第一次只WaitOne即可
if (Monitor.TryEnter(_mResetLock))
{
_mResetLocked = true;
this.isAccessTokenSet = false;
this.SecretToken = "";
//阻塞等待
mReset.Reset();//先关上大门。
////第一种写法
//Task.Factory.StartNew(() =>
//{
// //100毫秒不写也可以。 因为大门即使先打开set,后面再WaitOne拦也拦不住。
// Thread.Sleep(100);
// authAndGetToken();
//});
//第二种写法,打开大门
authAndGetToken();
mReset.WaitOne(); //通知每个人等一等。()
}
else
{
mReset.WaitOne();
}
}
else
{
mReset.WaitOne();
}
}
#endregion
#region 版本1
////业务代码
//KV tokenHeader = new KV("gh-sec-token", this.SecretToken);
//Dictionary<string, object> content = new Dictionary<string, object>();
//content.Add("cmd", cmd);
//content.Add("param", parameters);
//string bodyStr = JsonConvert.SerializeObject(content);
//HttpWebRequest request = WebRequest.Create(this.Enpoint + "/api") as HttpWebRequest;
//request.Headers.Add(tokenHeader.key, tokenHeader.value);
//request.ProtocolVersion = HttpVersion.Version10;
//request.Method = "POST";
////request.ContentType = "application/x-www-form-urlencoded";
//request.ContentType = "application/json";
//if (!String.IsNullOrWhiteSpace(bodyStr))
//{
// byte[] bytes = System.Text.Encoding.UTF8.GetBytes(bodyStr.ToString());
// using (Stream stream = request.GetRequestStream())
// {
// stream.Write(bytes, 0, bytes.Length);
// }
//}
//System.Net.HttpWebResponse publicresponse = (request.GetResponse() as HttpWebResponse);
//StreamReader publicsr = new StreamReader(publicresponse.GetResponseStream(), Encoding.UTF8);
//String resp = publicsr.ReadToEnd();
//return resp;
#endregion
//业务代码
KV tokenHeader = new KV("gh-sec-token", this.SecretToken);
Dictionary<string, object> content = new Dictionary<string, object>();
content.Add("cmd", cmd);
content.Add("param", parameters);
string jsonbody = JsonConvert.SerializeObject(content);
HttpResponseMessage response = HttpPostAsync(this.Enpoint + "/api", jsonbody, tokenHeader, "application/json").Result;
if (response != null && response.StatusCode == System.Net.HttpStatusCode.OK)
{
tryCount = 0;
result = response.Content.ReadAsStringAsync().Result;
}
else
{
if (tryCount < 3)
{
tryCount = tryCount + 1;
goto GetRequestNoResponse;
}
}
return result;
}
catch (Exception ex)
{
if (tryCount < 3)
{
tryCount = tryCount + 1;
goto GetRequestNoResponse;
}
throw;
return result;
}
}
/// <summary>
/// 随机数值
/// </summary>
/// <param name="length">length</param>
/// <returns></returns>
private string GetNonceString(int length = 8)
{
var sb = new StringBuilder();
var rnd = new Random();
for (var i = 0; i < length; i++)
{
sb.Append((char)rnd.Next(97, 123));
}
return sb.ToString();
}
private Task<HttpResponseMessage> HttpPostAsync(string api, string postData, KV tokenHeader = null, string ContentType = "application/x-www-form-urlencoded", CookieContainer cookieContainer = null, TimeSpan? timeout = null, string CharSet = "utf-8")
{
if (api.StartsWith("https"))
System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;
HttpContent httpContent = new StringContent(postData);
if (null != tokenHeader)
{
httpContent.Headers.Add(tokenHeader.key, tokenHeader.value);
}
httpContent.Headers.ContentType = new MediaTypeHeaderValue(ContentType);
httpContent.Headers.ContentType.CharSet = CharSet;
if (timeout.HasValue)
{
http.Timeout = timeout.Value;
}
if (null != cookieContainer)
{
handler.CookieContainer = cookieContainer;
}
return http.PostAsync(api, httpContent);
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{2B952B48-7EA9-4279-99B5-CA04872E7347}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>GHHttpClient</RootNamespace>
<AssemblyName>GHHttpClient</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="BouncyCastle.Crypto, Version=1.8.2.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
<HintPath>..\packages\BouncyCastle.1.8.2\lib\BouncyCastle.Crypto.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CryptoUtil.cs" />
<Compile Include="ESBFinder.cs" />
<Compile Include="ConnectionOptions.cs" />
<Compile Include="KV.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GHHttpClient
{
public class KV
{
public String key;
public String value;
public KV()
{
}
public KV(String k, String v)
{
this.key = k;
this.value = v;
}
//得到
public static String urlFormed(KV[] param)
{
StringBuilder payload = new StringBuilder();
KV[] arrayOfKV = param;
//得到KV对象数组的拼接结果,
foreach (var item in arrayOfKV)
{
KV pa = item;
// utf-8 编码默认情况
payload.Append(System.Net.WebUtility.UrlEncode(pa.key))
.Append(System.Net.WebUtility.UrlEncode(pa.value))
.Append("&");
}
payload= payload.Remove(payload.Length - 1,1);
return payload.ToString();
}
}
}
using System.Reflection;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("GHHttpClient")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("GHHttpClient")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("2b952b48-7ea9-4279-99b5-ca04872e7347")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
This source diff could not be displayed because it is too large. You can view the blob instead.
++ "b/14.java\350\275\254C#/TestC/GHHttpClient/obj/Debug/GHHttpClient.csproj.CopyComplete"
c250934ce8c26a28501162917f10eaad0dd666ce
c250934ce8c26a28501162917f10eaad0dd666ce
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\GHHttpClient.dll
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\GHHttpClient.dll
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\GHHttpClient.pdb
D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\Debug\GHHttpClient.csprojAssemblyReference.cache
D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\Debug\GHHttpClient.csproj.CoreCompileInputs.cache
D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\Debug\GHHttpClient.dll
D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\Debug\GHHttpClient.pdb
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\BouncyCastle.Crypto.dll
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\Newtonsoft.Json.dll
D:\smallproject\14.java转C#\TestC\GHHttpClient\bin\Debug\Newtonsoft.Json.xml
D:\smallproject\14.java转C#\TestC\GHHttpClient\obj\Debug\GHHttpClient.csproj.CopyComplete
++ "b/14.java\350\275\254C#/TestC/GHHttpClient/obj/Debug/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs"
++ "b/14.java\350\275\254C#/TestC/GHHttpClient/obj/Debug/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs"
++ "b/14.java\350\275\254C#/TestC/GHHttpClient/obj/Debug/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs"
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="BouncyCastle" version="1.8.2" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.2" targetFramework="net461" />
</packages>
\ No newline at end of file


......@@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestC", "TestC\TestC.csproj
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTestProject1", "UnitTestProject1\UnitTestProject1.csproj", "{3BB91B9E-4694-4844-A734-5229CC7CF3AE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestHttpClientGH", "TestHttpClientGH\TestHttpClientGH.csproj", "{6EF04946-198E-4A57-9660-9EFD79C14F77}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GHHttpClient", "GHHttpClient\GHHttpClient.csproj", "{2B952B48-7EA9-4279-99B5-CA04872E7347}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -21,6 +25,14 @@ Global
{3BB91B9E-4694-4844-A734-5229CC7CF3AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3BB91B9E-4694-4844-A734-5229CC7CF3AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3BB91B9E-4694-4844-A734-5229CC7CF3AE}.Release|Any CPU.Build.0 = Release|Any CPU
{6EF04946-198E-4A57-9660-9EFD79C14F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6EF04946-198E-4A57-9660-9EFD79C14F77}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6EF04946-198E-4A57-9660-9EFD79C14F77}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6EF04946-198E-4A57-9660-9EFD79C14F77}.Release|Any CPU.Build.0 = Release|Any CPU
{2B952B48-7EA9-4279-99B5-CA04872E7347}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2B952B48-7EA9-4279-99B5-CA04872E7347}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B952B48-7EA9-4279-99B5-CA04872E7347}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B952B48-7EA9-4279-99B5-CA04872E7347}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
using Newtonsoft.Json;
using Newtonsoft.Json;
......@@ -16,6 +16,43 @@ namespace TestC
public class ESBFinder
{
private static readonly String HEADER_TOKEN = "gh-sec-token";
//首先是默认属性的值。
//其次做成单例,timer构造函数时要启动。
//构造函数根据配置文件加载属性值
//其他调用只调用send即可。
//send 中判断过期时间 token是否有效,无效自动请求一次(请求时要加锁token的刷新)。
//使用TASK 不需要我定义异步函数(因为我没有需要await的计算),直接使用httppost的异步即可。
//public bool IsAuthorized
//{
// get { return isAccessTokenSet && !string.IsNullOrEmpty(AccessToken) && !string.IsNullOrEmpty(TokenType) && TokenExpiresTime > DateTime.Now.AddMinutes(10); }
//}
//全套从 System.Net.HttpWebRequest类库,升级为System.Net.Http类库、System.Net.Http类库、System.Net.Http.Headers类库
//参见;https://msdn.microsoft.com/zh-cn/library/system.net.http(v=vs.110).aspx
//参见;https://msdn.microsoft.com/zh-cn/library/system.net.http.headers(v=vs.110).aspx
//由于对.NET CORE 的多目标框架不熟,暂时先使用.NET 4.6.1撰写类库。
//收到数据错误,重发一次。
protected bool isAccessTokenSet = false;
private String appid;
private String secretMD5;
private String enpoint;
......@@ -23,14 +60,7 @@ namespace TestC
private long tokenValidity;
private Timer tokenTimer;
private long lastTokenTimestamp;
// try
//{
// ESBFinder.this.authAndGetToken();
//}
//catch (ESBFinderException e)
//{
// e.printStackTrace();
//}
#region HEXjavaC#写法
////java的方法内部封装的很原始,C#很方便。
......


using Newtonsoft.Json;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace TestC
{
/// <summary>
/// Taikor Open api Oauth 国海证券 client.
/// </summary>
public class TaikorOauthGHClient
{
public string UserId { get; protected set; }
public string AppSecret { get; protected set; }
public string AccessToken { get; set; }
public DateTime TokenExpiresTime { set; get; }
public string TokenType { set; get; }
public bool IsAuthorized
{
get { return isAccessTokenSet && !string.IsNullOrEmpty(AccessToken) && !string.IsNullOrEmpty(TokenType) && TokenExpiresTime > DateTime.Now.AddMinutes(10); }
}
protected string BaseApiUrl
{
get
{
return "https://api.palaspom.com/";
}
}
protected bool isAccessTokenSet = false;
protected HttpClient http;
protected HttpClientHandler handler;
public HttpResponseMessage HttpGet(string api, object parameters, bool needAuthorized = true)
{
HttpResponseMessage result = HttpGetAsync(api, parameters, needAuthorized).Result;
if (result != null && (result.StatusCode == HttpStatusCode.Unauthorized || result.StatusCode == HttpStatusCode.Forbidden))
{
isAccessTokenSet = false;
result = HttpGetAsync(api, parameters, needAuthorized).Result;
}
return result;
}
private Task<HttpResponseMessage> HttpGetAsync(string api, object parameters, bool needAuthorized = true)
{
var paramType = parameters.GetType();
if (!(paramType.Name.Contains("AnonymousType") && paramType.Namespace == null))
{
throw new ArgumentException("Only anonymous type parameters are supported.");
}
var dict = paramType.GetProperties().ToDictionary(k => k.Name, v => string.Format("{0}", v.GetValue(parameters, null)));
return HttpGetAsync(api, dict, needAuthorized);
}
public HttpResponseMessage HttpGet(string api, Dictionary<string, object> parameters = null, bool needAuthorized = true)
{
HttpResponseMessage result = HttpGetAsync(api, parameters, needAuthorized).Result;
if (result != null && (result.StatusCode == HttpStatusCode.Unauthorized || result.StatusCode == HttpStatusCode.Forbidden))
{
isAccessTokenSet = false;
result = HttpGetAsync(api, parameters, needAuthorized).Result;
}
return result;
}
private Task<HttpResponseMessage> HttpGetAsync(string api, Dictionary<string, object> parameters = null, bool needAuthorized = true)
{
if (!needAuthorized || IsAuthorized || RequestToken())
{
if (parameters == null)
parameters = new Dictionary<string, object>();
var queryString = string.Join("&", parameters.Select(p => string.Format("{0}={1}", Uri.EscapeDataString(p.Key), Uri.EscapeDataString(string.Format("{0}", p.Value)))));
if (api.IndexOf("?") < 0)
{
api = string.Format("{0}?{1}", api, queryString);
}
else
{
api = string.Format("{0}&{1}", api, queryString);
}
api = api.Trim('&', '?');
//If the result is
return http.GetAsync(api);
}
else
throw new Exception("Error, Has refused to authorize this request.");
}
public HttpResponseMessage HttpPost(string api, object parameters, bool needAuthorized = true)
{
HttpResponseMessage result = HttpPostAsync(api, parameters, needAuthorized).Result;
if (result != null && (result.StatusCode == HttpStatusCode.Unauthorized || result.StatusCode == HttpStatusCode.Forbidden))
{
isAccessTokenSet = false;
result = HttpPostAsync(api, parameters, needAuthorized).Result;
}
return result;
}
private Task<HttpResponseMessage> HttpPostAsync(string api, object parameters, bool needAuthorized = true)
{
var paramType = parameters.GetType();
if (!(paramType.Name.Contains("AnonymousType") && paramType.Namespace == null))
{
throw new ArgumentException("Only anonymous type parameters are supported.");
}
var dict = paramType.GetProperties().ToDictionary(k => k.Name, v => v.GetValue(parameters, null));
return HttpPostAsync(api, dict, needAuthorized);
}
public HttpResponseMessage HttpPost(string api, Dictionary<string, object> parameters, bool needAuthorized = true)
{
HttpResponseMessage result = HttpPostAsync(api, parameters, needAuthorized).Result;
if (result != null && (result.StatusCode == HttpStatusCode.Unauthorized || result.StatusCode == HttpStatusCode.Forbidden))
{
isAccessTokenSet = false;
result = HttpPostAsync(api, parameters, needAuthorized).Result;
}
return result;
}
private Task<HttpResponseMessage> HttpPostAsync(string api, Dictionary<string, object> parameters, bool needAuthorized = true)
{
if (!needAuthorized || IsAuthorized || RequestToken())
{
if (parameters == null)
parameters = new Dictionary<string, object>();
var dict = new Dictionary<string, object>(parameters.ToDictionary(k => k.Key, v => v.Value));
HttpContent httpContent = null;
if (dict.Count(p => p.Value.GetType() == typeof(byte[]) || p.Value.GetType() == typeof(System.IO.FileInfo)) > 0)
{
var content = new MultipartFormDataContent();
foreach (var param in dict)
{
var dataType = param.Value.GetType();
if (dataType == typeof(byte[])) //byte[]
{
content.Add(new ByteArrayContent((byte[])param.Value), param.Key, GetNonceString());
}
else if (dataType == typeof(System.IO.FileInfo))
{
var file = (System.IO.FileInfo)param.Value;
content.Add(new ByteArrayContent(System.IO.File.ReadAllBytes(file.FullName)), param.Key, file.Name);
}
else
{
content.Add(new StringContent(string.Format("{0}", param.Value)), param.Key);
}
}
httpContent = content;
}
else
{
var content = new FormUrlEncodedContent(dict.ToDictionary(k => k.Key, v => string.Format("{0}", v.Value)));
httpContent = content;
}
return http.PostAsync(api, httpContent);
}
else
throw new Exception("Error, Has refused to authorize this request.");
}
/// <summary>
/// Init method
/// </summary>
/// <param name="userId">UserId</param>
/// <param name="appSecret">AppSecret</param>
public TaikorOauthClient(string userId, string appSecret)
{
this.UserId = userId;
this.AppSecret = appSecret;
var handler = new HttpClientHandler()
{
CookieContainer = new CookieContainer(),
UseCookies = true,
AutomaticDecompression = DecompressionMethods.GZip
};
http = new HttpClient(handler)
{
BaseAddress = new Uri(BaseApiUrl),
Timeout = new TimeSpan(0, 0, 30)
};
if (!RequestToken())
{
throw new Exception("Init the client error, Please check UserId and AppSecert setting. Or you can retry it.");
}
}
/// <summary>
/// Get the Nonce String
/// </summary>
/// <param name="length">length</param>
/// <returns></returns>
private string GetNonceString(int length = 8)
{
var sb = new StringBuilder();
var rnd = new Random();
for (var i = 0; i < length; i++)
{
sb.Append((char)rnd.Next(97, 123));
}
return sb.ToString();
}
/// <summary>
/// Request the Access Token
/// </summary>
/// <returns></returns>
public bool RequestToken()
{
if (string.IsNullOrEmpty(UserId) || string.IsNullOrEmpty(AppSecret))
throw new ArgumentException("Please set the UserId and AppSecert before you request. You can get this from https://daas.palaspom.com/Login/Authority.");
Dictionary<string, object> parameters = new Dictionary<string, object>();
parameters.Add("userId", UserId);
parameters.Add("appSecert", AppSecret);
isAccessTokenSet = false;
http.DefaultRequestHeaders.Remove("Authorization");
HttpResponseMessage result = HttpGet("Oauth2/Authorize", parameters, false);
if (result != null && result.IsSuccessStatusCode && result.Content != null)
{
string tokenResult = result.Content.ReadAsStringAsync().Result;
TaikorToken token = JsonConvert.DeserializeObject<TaikorToken>(tokenResult);
if (token != null && !token.IsError && !token.IsHttpError && !string.IsNullOrEmpty(token.AccessToken))
{
TokenExpiresTime = DateTime.Now.AddSeconds(token.ExpiresIn);
AccessToken = token.AccessToken;
TokenType = token.TokenType;
isAccessTokenSet = true;
http.DefaultRequestHeaders.Add("Authorization", TokenType + " " + AccessToken);
return true;
}
}
return false;
}
/// <summary>
/// 设置cookies
/// </summary>
/// <param name="cookieContainer">The set cookie.</param>
/// <returns></returns>
private void SetCookie(CookieContainer cookieContainer)
{
handler.CookieContainer = cookieContainer;
}
/// <summary>
/// Get all cookies from CookieContainer.
/// </summary>
/// <returns>List of cookie</returns>
public Dictionary<string, string> GetAllCookies()
{
CookieContainer cookieContainer = handler.CookieContainer;
Dictionary<string, string> cookies = new Dictionary<string, string>();
Hashtable table = (Hashtable)cookieContainer.GetType().InvokeMember("m_domainTable",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetField |
System.Reflection.BindingFlags.Instance, null, cookieContainer, new object[] { });
foreach (string pathList in table.Keys)
{
StringBuilder _cookie = new StringBuilder();
SortedList cookieColList = (SortedList)table[pathList].GetType().InvokeMember("m_list",
System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.GetField
| System.Reflection.BindingFlags.Instance, null, table[pathList], new object[] { });
foreach (CookieCollection colCookies in cookieColList.Values)
foreach (Cookie c in colCookies)
_cookie.Append(c.Name + "=" + c.Value + ";");
cookies.Add(pathList, _cookie.ToString().TrimEnd(';'));
}
return cookies;
}
/// <summary>
/// convert cookies string to CookieContainer
/// </summary>
/// <param name="cookies">cookies dictionary.</param>
/// <returns>the CookieContainer</returns>
public static CookieContainer ConvertToCookieContainer(Dictionary<string, string> cookies)
{
CookieContainer cookieContainer = new CookieContainer();
foreach (var cookie in cookies)
{
string[] strEachCookParts = cookie.Value.Split(';');
int intEachCookPartsCount = strEachCookParts.Length;
foreach (string strCNameAndCValue in strEachCookParts)
{
if (!string.IsNullOrEmpty(strCNameAndCValue))
{
try
{
Cookie cookTemp = new Cookie();
int firstEqual = strCNameAndCValue.IndexOf("=");
string firstName = strCNameAndCValue.Substring(0, firstEqual);
string allValue = strCNameAndCValue.Substring(firstEqual + 1, strCNameAndCValue.Length - (firstEqual + 1));
cookTemp.Name = firstName;
cookTemp.Value = allValue;
cookTemp.Path = "/";
cookTemp.Domain = cookie.Key;
cookieContainer.Add(cookTemp);
}
catch (Exception ex)
{
//do nothing.
}
}
}
}
return cookieContainer;
}
}
}
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Taikor.Opensdk
{
/// <summary>
/// Taikor 用于返回的Token类
/// </summary>
public class TaikorGHToken
{
/// <summary>
/// Access Token,
/// </summary>
public string AccessToken { get; set; }
/// <summary>
/// 错误信息
/// </summary>
public string Error { get; set; }
/// <summary>
/// 过期时间
/// </summary>
public long ExpiresIn { get; set; }
/// <summary>
/// Http错误信息
/// </summary>
public string HttpErrorReason { get; set; }
/// <summary>
/// Http错误状态码
/// </summary>
public int HttpErrorStatusCode { get; set; }
/// <summary>
/// 是否错误
/// </summary>
public bool IsError { get; set; }
/// <summary>
/// 是否Http错误
/// </summary>
public bool IsHttpError { get; set; }
/// <summary>
/// Refresh Token
/// </summary>
public string RefreshToken { get; set; }
/// <summary>
/// Token Type
/// </summary>
public string TokenType { get; set; }
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
......@@ -55,6 +55,7 @@
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RSAKeyConvert.cs" />
<Compile Include="TaikorToken.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
......
2dc95b9ac18ba069502ac00f0465914a0420bd47
114fe3febf5ff50165bddc6e9c9ff3d01b4458aa
2dc95b9ac18ba069502ac00f0465914a0420bd47
114fe3febf5ff50165bddc6e9c9ff3d01b4458aa
using System;
using System;
namespace TestHttpClientGH
{
public class Class1
{
}
}
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>
++ "b/14.java\350\275\254C#/TestC/TestHttpClientGH/obj/Debug/netcoreapp2.1/TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs"
++ "b/14.java\350\275\254C#/TestC/TestHttpClientGH/obj/Debug/netcoreapp2.1/TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs"
++ "b/14.java\350\275\254C#/TestC/TestHttpClientGH/obj/Debug/netcoreapp2.1/TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs"
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TestHttpClientGH")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("TestHttpClientGH")]
[assembly: System.Reflection.AssemblyTitleAttribute("TestHttpClientGH")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// 由 MSBuild WriteCodeFragment 类生成。
2bbc96b9274398b4eaeeca9b5f56f3fc06843fbc
2bbc96b9274398b4eaeeca9b5f56f3fc06843fbc
77ab26723aa84b8092e95a97b8f61e4a57168549
77ab26723aa84b8092e95a97b8f61e4a57168549
{
{
"version": 1,
"dgSpecHash": "ZQAP5/lj1nNO5fAIJ4jz/xn23dicAXoOOUypQxy55kyw6US8CqZwXoWa3jetuR8ZXCtuMMWJXBf2lk3uVyWvGQ==",
"success": true
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\smallproject\14.java转C#\TestC\TestHttpClientGH\obj\project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\admin\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.7.0</NuGetToolVersion>
</PropertyGroup>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.props" Condition="Exists('$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.props')" />
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<Import Project="C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />
<Import Project="$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.targets" Condition="Exists('$(NuGetPackageRoot)microsoft.netcore.app\2.1.0\build\netcoreapp2.1\Microsoft.NETCore.App.targets')" />
</ImportGroup>
</Project>
\ No newline at end of file
{
{
"version": 3,
"targets": {
".NETCoreApp,Version=v2.1": {
"Microsoft.NETCore.App/2.1.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.DotNetHostPolicy": "2.1.0",
"Microsoft.NETCore.Platforms": "2.1.0",
"Microsoft.NETCore.Targets": "2.1.0",
"NETStandard.Library": "2.0.3"
},
"compile": {
"ref/netcoreapp2.1/Microsoft.CSharp.dll": {},
"ref/netcoreapp2.1/Microsoft.VisualBasic.dll": {},
"ref/netcoreapp2.1/Microsoft.Win32.Primitives.dll": {},
"ref/netcoreapp2.1/System.AppContext.dll": {},
"ref/netcoreapp2.1/System.Buffers.dll": {},
"ref/netcoreapp2.1/System.Collections.Concurrent.dll": {},
"ref/netcoreapp2.1/System.Collections.Immutable.dll": {},
"ref/netcoreapp2.1/System.Collections.NonGeneric.dll": {},
"ref/netcoreapp2.1/System.Collections.Specialized.dll": {},
"ref/netcoreapp2.1/System.Collections.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.Annotations.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.DataAnnotations.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.EventBasedAsync.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.Primitives.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.TypeConverter.dll": {},
"ref/netcoreapp2.1/System.ComponentModel.dll": {},
"ref/netcoreapp2.1/System.Configuration.dll": {},
"ref/netcoreapp2.1/System.Console.dll": {},
"ref/netcoreapp2.1/System.Core.dll": {},
"ref/netcoreapp2.1/System.Data.Common.dll": {},
"ref/netcoreapp2.1/System.Data.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Contracts.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Debug.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.FileVersionInfo.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Process.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.StackTrace.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.TextWriterTraceListener.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Tools.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.TraceSource.dll": {},
"ref/netcoreapp2.1/System.Diagnostics.Tracing.dll": {},
"ref/netcoreapp2.1/System.Drawing.Primitives.dll": {},
"ref/netcoreapp2.1/System.Drawing.dll": {},
"ref/netcoreapp2.1/System.Dynamic.Runtime.dll": {},
"ref/netcoreapp2.1/System.Globalization.Calendars.dll": {},
"ref/netcoreapp2.1/System.Globalization.Extensions.dll": {},
"ref/netcoreapp2.1/System.Globalization.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.Brotli.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.FileSystem.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.ZipFile.dll": {},
"ref/netcoreapp2.1/System.IO.Compression.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.DriveInfo.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.Primitives.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.Watcher.dll": {},
"ref/netcoreapp2.1/System.IO.FileSystem.dll": {},
"ref/netcoreapp2.1/System.IO.IsolatedStorage.dll": {},
"ref/netcoreapp2.1/System.IO.MemoryMappedFiles.dll": {},
"ref/netcoreapp2.1/System.IO.Pipes.dll": {},
"ref/netcoreapp2.1/System.IO.UnmanagedMemoryStream.dll": {},
"ref/netcoreapp2.1/System.IO.dll": {},
"ref/netcoreapp2.1/System.Linq.Expressions.dll": {},
"ref/netcoreapp2.1/System.Linq.Parallel.dll": {},
"ref/netcoreapp2.1/System.Linq.Queryable.dll": {},
"ref/netcoreapp2.1/System.Linq.dll": {},
"ref/netcoreapp2.1/System.Memory.dll": {},
"ref/netcoreapp2.1/System.Net.Http.dll": {},
"ref/netcoreapp2.1/System.Net.HttpListener.dll": {},
"ref/netcoreapp2.1/System.Net.Mail.dll": {},
"ref/netcoreapp2.1/System.Net.NameResolution.dll": {},
"ref/netcoreapp2.1/System.Net.NetworkInformation.dll": {},
"ref/netcoreapp2.1/System.Net.Ping.dll": {},
"ref/netcoreapp2.1/System.Net.Primitives.dll": {},
"ref/netcoreapp2.1/System.Net.Requests.dll": {},
"ref/netcoreapp2.1/System.Net.Security.dll": {},
"ref/netcoreapp2.1/System.Net.ServicePoint.dll": {},
"ref/netcoreapp2.1/System.Net.Sockets.dll": {},
"ref/netcoreapp2.1/System.Net.WebClient.dll": {},
"ref/netcoreapp2.1/System.Net.WebHeaderCollection.dll": {},
"ref/netcoreapp2.1/System.Net.WebProxy.dll": {},
"ref/netcoreapp2.1/System.Net.WebSockets.Client.dll": {},
"ref/netcoreapp2.1/System.Net.WebSockets.dll": {},
"ref/netcoreapp2.1/System.Net.dll": {},
"ref/netcoreapp2.1/System.Numerics.Vectors.dll": {},
"ref/netcoreapp2.1/System.Numerics.dll": {},
"ref/netcoreapp2.1/System.ObjectModel.dll": {},
"ref/netcoreapp2.1/System.Reflection.DispatchProxy.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.ILGeneration.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.Lightweight.dll": {},
"ref/netcoreapp2.1/System.Reflection.Emit.dll": {},
"ref/netcoreapp2.1/System.Reflection.Extensions.dll": {},
"ref/netcoreapp2.1/System.Reflection.Metadata.dll": {},
"ref/netcoreapp2.1/System.Reflection.Primitives.dll": {},
"ref/netcoreapp2.1/System.Reflection.TypeExtensions.dll": {},
"ref/netcoreapp2.1/System.Reflection.dll": {},
"ref/netcoreapp2.1/System.Resources.Reader.dll": {},
"ref/netcoreapp2.1/System.Resources.ResourceManager.dll": {},
"ref/netcoreapp2.1/System.Resources.Writer.dll": {},
"ref/netcoreapp2.1/System.Runtime.CompilerServices.VisualC.dll": {},
"ref/netcoreapp2.1/System.Runtime.Extensions.dll": {},
"ref/netcoreapp2.1/System.Runtime.Handles.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.RuntimeInformation.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.WindowsRuntime.dll": {},
"ref/netcoreapp2.1/System.Runtime.InteropServices.dll": {},
"ref/netcoreapp2.1/System.Runtime.Loader.dll": {},
"ref/netcoreapp2.1/System.Runtime.Numerics.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Formatters.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Json.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Primitives.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.Xml.dll": {},
"ref/netcoreapp2.1/System.Runtime.Serialization.dll": {},
"ref/netcoreapp2.1/System.Runtime.dll": {},
"ref/netcoreapp2.1/System.Security.Claims.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Algorithms.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Csp.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Encoding.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.Primitives.dll": {},
"ref/netcoreapp2.1/System.Security.Cryptography.X509Certificates.dll": {},
"ref/netcoreapp2.1/System.Security.Principal.dll": {},
"ref/netcoreapp2.1/System.Security.SecureString.dll": {},
"ref/netcoreapp2.1/System.Security.dll": {},
"ref/netcoreapp2.1/System.ServiceModel.Web.dll": {},
"ref/netcoreapp2.1/System.ServiceProcess.dll": {},
"ref/netcoreapp2.1/System.Text.Encoding.Extensions.dll": {},
"ref/netcoreapp2.1/System.Text.Encoding.dll": {},
"ref/netcoreapp2.1/System.Text.RegularExpressions.dll": {},
"ref/netcoreapp2.1/System.Threading.Overlapped.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Dataflow.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Extensions.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.Parallel.dll": {},
"ref/netcoreapp2.1/System.Threading.Tasks.dll": {},
"ref/netcoreapp2.1/System.Threading.Thread.dll": {},
"ref/netcoreapp2.1/System.Threading.ThreadPool.dll": {},
"ref/netcoreapp2.1/System.Threading.Timer.dll": {},
"ref/netcoreapp2.1/System.Threading.dll": {},
"ref/netcoreapp2.1/System.Transactions.Local.dll": {},
"ref/netcoreapp2.1/System.Transactions.dll": {},
"ref/netcoreapp2.1/System.ValueTuple.dll": {},
"ref/netcoreapp2.1/System.Web.HttpUtility.dll": {},
"ref/netcoreapp2.1/System.Web.dll": {},
"ref/netcoreapp2.1/System.Windows.dll": {},
"ref/netcoreapp2.1/System.Xml.Linq.dll": {},
"ref/netcoreapp2.1/System.Xml.ReaderWriter.dll": {},
"ref/netcoreapp2.1/System.Xml.Serialization.dll": {},
"ref/netcoreapp2.1/System.Xml.XDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XPath.XDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XPath.dll": {},
"ref/netcoreapp2.1/System.Xml.XmlDocument.dll": {},
"ref/netcoreapp2.1/System.Xml.XmlSerializer.dll": {},
"ref/netcoreapp2.1/System.Xml.dll": {},
"ref/netcoreapp2.1/System.dll": {},
"ref/netcoreapp2.1/WindowsBase.dll": {},
"ref/netcoreapp2.1/mscorlib.dll": {},
"ref/netcoreapp2.1/netstandard.dll": {}
},
"build": {
"build/netcoreapp2.1/Microsoft.NETCore.App.props": {},
"build/netcoreapp2.1/Microsoft.NETCore.App.targets": {}
}
},
"Microsoft.NETCore.DotNetAppHost/2.1.0": {
"type": "package"
},
"Microsoft.NETCore.DotNetHostPolicy/2.1.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.DotNetHostResolver": "2.1.0"
}
},
"Microsoft.NETCore.DotNetHostResolver/2.1.0": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.DotNetAppHost": "2.1.0"
}
},
"Microsoft.NETCore.Platforms/2.1.0": {
"type": "package",
"compile": {
"lib/netstandard1.0/_._": {}
},
"runtime": {
"lib/netstandard1.0/_._": {}
}
},
"Microsoft.NETCore.Targets/2.1.0": {
"type": "package",
"compile": {
"lib/netstandard1.0/_._": {}
},
"runtime": {
"lib/netstandard1.0/_._": {}
}
},
"NETStandard.Library/2.0.3": {
"type": "package",
"dependencies": {
"Microsoft.NETCore.Platforms": "1.1.0"
},
"compile": {
"lib/netstandard1.0/_._": {}
},
"runtime": {
"lib/netstandard1.0/_._": {}
},
"build": {
"build/netstandard2.0/NETStandard.Library.targets": {}
}
}
}
},
"libraries": {
"Microsoft.NETCore.App/2.1.0": {
"sha512": "AvT774nTFgU8cYcGO9j1EMwuayKslxqYTurg32HGpWa2hEYNuW2+XgYVVNcZe6Ndbr84QX6fwaOZfd5n+1m2OA==",
"type": "package",
"path": "microsoft.netcore.app/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"Microsoft.NETCore.App.versions.txt",
"THIRD-PARTY-NOTICES.TXT",
"build/netcoreapp2.1/Microsoft.NETCore.App.PlatformManifest.txt",
"build/netcoreapp2.1/Microsoft.NETCore.App.props",
"build/netcoreapp2.1/Microsoft.NETCore.App.targets",
"microsoft.netcore.app.2.1.0.nupkg.sha512",
"microsoft.netcore.app.nuspec",
"ref/netcoreapp/_._",
"ref/netcoreapp2.1/Microsoft.CSharp.dll",
"ref/netcoreapp2.1/Microsoft.CSharp.xml",
"ref/netcoreapp2.1/Microsoft.VisualBasic.dll",
"ref/netcoreapp2.1/Microsoft.VisualBasic.xml",
"ref/netcoreapp2.1/Microsoft.Win32.Primitives.dll",
"ref/netcoreapp2.1/Microsoft.Win32.Primitives.xml",
"ref/netcoreapp2.1/System.AppContext.dll",
"ref/netcoreapp2.1/System.Buffers.dll",
"ref/netcoreapp2.1/System.Buffers.xml",
"ref/netcoreapp2.1/System.Collections.Concurrent.dll",
"ref/netcoreapp2.1/System.Collections.Concurrent.xml",
"ref/netcoreapp2.1/System.Collections.Immutable.dll",
"ref/netcoreapp2.1/System.Collections.Immutable.xml",
"ref/netcoreapp2.1/System.Collections.NonGeneric.dll",
"ref/netcoreapp2.1/System.Collections.NonGeneric.xml",
"ref/netcoreapp2.1/System.Collections.Specialized.dll",
"ref/netcoreapp2.1/System.Collections.Specialized.xml",
"ref/netcoreapp2.1/System.Collections.dll",
"ref/netcoreapp2.1/System.Collections.xml",
"ref/netcoreapp2.1/System.ComponentModel.Annotations.dll",
"ref/netcoreapp2.1/System.ComponentModel.Annotations.xml",
"ref/netcoreapp2.1/System.ComponentModel.DataAnnotations.dll",
"ref/netcoreapp2.1/System.ComponentModel.EventBasedAsync.dll",
"ref/netcoreapp2.1/System.ComponentModel.EventBasedAsync.xml",
"ref/netcoreapp2.1/System.ComponentModel.Primitives.dll",
"ref/netcoreapp2.1/System.ComponentModel.Primitives.xml",
"ref/netcoreapp2.1/System.ComponentModel.TypeConverter.dll",
"ref/netcoreapp2.1/System.ComponentModel.TypeConverter.xml",
"ref/netcoreapp2.1/System.ComponentModel.dll",
"ref/netcoreapp2.1/System.ComponentModel.xml",
"ref/netcoreapp2.1/System.Configuration.dll",
"ref/netcoreapp2.1/System.Console.dll",
"ref/netcoreapp2.1/System.Console.xml",
"ref/netcoreapp2.1/System.Core.dll",
"ref/netcoreapp2.1/System.Data.Common.dll",
"ref/netcoreapp2.1/System.Data.Common.xml",
"ref/netcoreapp2.1/System.Data.dll",
"ref/netcoreapp2.1/System.Diagnostics.Contracts.dll",
"ref/netcoreapp2.1/System.Diagnostics.Contracts.xml",
"ref/netcoreapp2.1/System.Diagnostics.Debug.dll",
"ref/netcoreapp2.1/System.Diagnostics.Debug.xml",
"ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.dll",
"ref/netcoreapp2.1/System.Diagnostics.DiagnosticSource.xml",
"ref/netcoreapp2.1/System.Diagnostics.FileVersionInfo.dll",
"ref/netcoreapp2.1/System.Diagnostics.FileVersionInfo.xml",
"ref/netcoreapp2.1/System.Diagnostics.Process.dll",
"ref/netcoreapp2.1/System.Diagnostics.Process.xml",
"ref/netcoreapp2.1/System.Diagnostics.StackTrace.dll",
"ref/netcoreapp2.1/System.Diagnostics.StackTrace.xml",
"ref/netcoreapp2.1/System.Diagnostics.TextWriterTraceListener.dll",
"ref/netcoreapp2.1/System.Diagnostics.TextWriterTraceListener.xml",
"ref/netcoreapp2.1/System.Diagnostics.Tools.dll",
"ref/netcoreapp2.1/System.Diagnostics.Tools.xml",
"ref/netcoreapp2.1/System.Diagnostics.TraceSource.dll",
"ref/netcoreapp2.1/System.Diagnostics.TraceSource.xml",
"ref/netcoreapp2.1/System.Diagnostics.Tracing.dll",
"ref/netcoreapp2.1/System.Diagnostics.Tracing.xml",
"ref/netcoreapp2.1/System.Drawing.Primitives.dll",
"ref/netcoreapp2.1/System.Drawing.Primitives.xml",
"ref/netcoreapp2.1/System.Drawing.dll",
"ref/netcoreapp2.1/System.Dynamic.Runtime.dll",
"ref/netcoreapp2.1/System.Globalization.Calendars.dll",
"ref/netcoreapp2.1/System.Globalization.Extensions.dll",
"ref/netcoreapp2.1/System.Globalization.dll",
"ref/netcoreapp2.1/System.IO.Compression.Brotli.dll",
"ref/netcoreapp2.1/System.IO.Compression.FileSystem.dll",
"ref/netcoreapp2.1/System.IO.Compression.ZipFile.dll",
"ref/netcoreapp2.1/System.IO.Compression.ZipFile.xml",
"ref/netcoreapp2.1/System.IO.Compression.dll",
"ref/netcoreapp2.1/System.IO.Compression.xml",
"ref/netcoreapp2.1/System.IO.FileSystem.DriveInfo.dll",
"ref/netcoreapp2.1/System.IO.FileSystem.DriveInfo.xml",
"ref/netcoreapp2.1/System.IO.FileSystem.Primitives.dll",
"ref/netcoreapp2.1/System.IO.FileSystem.Watcher.dll",
"ref/netcoreapp2.1/System.IO.FileSystem.Watcher.xml",
"ref/netcoreapp2.1/System.IO.FileSystem.dll",
"ref/netcoreapp2.1/System.IO.FileSystem.xml",
"ref/netcoreapp2.1/System.IO.IsolatedStorage.dll",
"ref/netcoreapp2.1/System.IO.IsolatedStorage.xml",
"ref/netcoreapp2.1/System.IO.MemoryMappedFiles.dll",
"ref/netcoreapp2.1/System.IO.MemoryMappedFiles.xml",
"ref/netcoreapp2.1/System.IO.Pipes.dll",
"ref/netcoreapp2.1/System.IO.Pipes.xml",
"ref/netcoreapp2.1/System.IO.UnmanagedMemoryStream.dll",
"ref/netcoreapp2.1/System.IO.dll",
"ref/netcoreapp2.1/System.Linq.Expressions.dll",
"ref/netcoreapp2.1/System.Linq.Expressions.xml",
"ref/netcoreapp2.1/System.Linq.Parallel.dll",
"ref/netcoreapp2.1/System.Linq.Parallel.xml",
"ref/netcoreapp2.1/System.Linq.Queryable.dll",
"ref/netcoreapp2.1/System.Linq.Queryable.xml",
"ref/netcoreapp2.1/System.Linq.dll",
"ref/netcoreapp2.1/System.Linq.xml",
"ref/netcoreapp2.1/System.Memory.dll",
"ref/netcoreapp2.1/System.Memory.xml",
"ref/netcoreapp2.1/System.Net.Http.dll",
"ref/netcoreapp2.1/System.Net.Http.xml",
"ref/netcoreapp2.1/System.Net.HttpListener.dll",
"ref/netcoreapp2.1/System.Net.HttpListener.xml",
"ref/netcoreapp2.1/System.Net.Mail.dll",
"ref/netcoreapp2.1/System.Net.Mail.xml",
"ref/netcoreapp2.1/System.Net.NameResolution.dll",
"ref/netcoreapp2.1/System.Net.NameResolution.xml",
"ref/netcoreapp2.1/System.Net.NetworkInformation.dll",
"ref/netcoreapp2.1/System.Net.NetworkInformation.xml",
"ref/netcoreapp2.1/System.Net.Ping.dll",
"ref/netcoreapp2.1/System.Net.Ping.xml",
"ref/netcoreapp2.1/System.Net.Primitives.dll",
"ref/netcoreapp2.1/System.Net.Primitives.xml",
"ref/netcoreapp2.1/System.Net.Requests.dll",
"ref/netcoreapp2.1/System.Net.Requests.xml",
"ref/netcoreapp2.1/System.Net.Security.dll",
"ref/netcoreapp2.1/System.Net.Security.xml",
"ref/netcoreapp2.1/System.Net.ServicePoint.dll",
"ref/netcoreapp2.1/System.Net.ServicePoint.xml",
"ref/netcoreapp2.1/System.Net.Sockets.dll",
"ref/netcoreapp2.1/System.Net.Sockets.xml",
"ref/netcoreapp2.1/System.Net.WebClient.dll",
"ref/netcoreapp2.1/System.Net.WebClient.xml",
"ref/netcoreapp2.1/System.Net.WebHeaderCollection.dll",
"ref/netcoreapp2.1/System.Net.WebHeaderCollection.xml",
"ref/netcoreapp2.1/System.Net.WebProxy.dll",
"ref/netcoreapp2.1/System.Net.WebProxy.xml",
"ref/netcoreapp2.1/System.Net.WebSockets.Client.dll",
"ref/netcoreapp2.1/System.Net.WebSockets.Client.xml",
"ref/netcoreapp2.1/System.Net.WebSockets.dll",
"ref/netcoreapp2.1/System.Net.WebSockets.xml",
"ref/netcoreapp2.1/System.Net.dll",
"ref/netcoreapp2.1/System.Numerics.Vectors.dll",
"ref/netcoreapp2.1/System.Numerics.Vectors.xml",
"ref/netcoreapp2.1/System.Numerics.dll",
"ref/netcoreapp2.1/System.ObjectModel.dll",
"ref/netcoreapp2.1/System.ObjectModel.xml",
"ref/netcoreapp2.1/System.Reflection.DispatchProxy.dll",
"ref/netcoreapp2.1/System.Reflection.DispatchProxy.xml",
"ref/netcoreapp2.1/System.Reflection.Emit.ILGeneration.dll",
"ref/netcoreapp2.1/System.Reflection.Emit.ILGeneration.xml",
"ref/netcoreapp2.1/System.Reflection.Emit.Lightweight.dll",
"ref/netcoreapp2.1/System.Reflection.Emit.Lightweight.xml",
"ref/netcoreapp2.1/System.Reflection.Emit.dll",
"ref/netcoreapp2.1/System.Reflection.Emit.xml",
"ref/netcoreapp2.1/System.Reflection.Extensions.dll",
"ref/netcoreapp2.1/System.Reflection.Metadata.dll",
"ref/netcoreapp2.1/System.Reflection.Metadata.xml",
"ref/netcoreapp2.1/System.Reflection.Primitives.dll",
"ref/netcoreapp2.1/System.Reflection.Primitives.xml",
"ref/netcoreapp2.1/System.Reflection.TypeExtensions.dll",
"ref/netcoreapp2.1/System.Reflection.TypeExtensions.xml",
"ref/netcoreapp2.1/System.Reflection.dll",
"ref/netcoreapp2.1/System.Resources.Reader.dll",
"ref/netcoreapp2.1/System.Resources.ResourceManager.dll",
"ref/netcoreapp2.1/System.Resources.ResourceManager.xml",
"ref/netcoreapp2.1/System.Resources.Writer.dll",
"ref/netcoreapp2.1/System.Resources.Writer.xml",
"ref/netcoreapp2.1/System.Runtime.CompilerServices.VisualC.dll",
"ref/netcoreapp2.1/System.Runtime.CompilerServices.VisualC.xml",
"ref/netcoreapp2.1/System.Runtime.Extensions.dll",
"ref/netcoreapp2.1/System.Runtime.Extensions.xml",
"ref/netcoreapp2.1/System.Runtime.Handles.dll",
"ref/netcoreapp2.1/System.Runtime.InteropServices.RuntimeInformation.dll",
"ref/netcoreapp2.1/System.Runtime.InteropServices.RuntimeInformation.xml",
"ref/netcoreapp2.1/System.Runtime.InteropServices.WindowsRuntime.dll",
"ref/netcoreapp2.1/System.Runtime.InteropServices.WindowsRuntime.xml",
"ref/netcoreapp2.1/System.Runtime.InteropServices.dll",
"ref/netcoreapp2.1/System.Runtime.InteropServices.xml",
"ref/netcoreapp2.1/System.Runtime.Loader.dll",
"ref/netcoreapp2.1/System.Runtime.Loader.xml",
"ref/netcoreapp2.1/System.Runtime.Numerics.dll",
"ref/netcoreapp2.1/System.Runtime.Numerics.xml",
"ref/netcoreapp2.1/System.Runtime.Serialization.Formatters.dll",
"ref/netcoreapp2.1/System.Runtime.Serialization.Formatters.xml",
"ref/netcoreapp2.1/System.Runtime.Serialization.Json.dll",
"ref/netcoreapp2.1/System.Runtime.Serialization.Json.xml",
"ref/netcoreapp2.1/System.Runtime.Serialization.Primitives.dll",
"ref/netcoreapp2.1/System.Runtime.Serialization.Primitives.xml",
"ref/netcoreapp2.1/System.Runtime.Serialization.Xml.dll",
"ref/netcoreapp2.1/System.Runtime.Serialization.Xml.xml",
"ref/netcoreapp2.1/System.Runtime.Serialization.dll",
"ref/netcoreapp2.1/System.Runtime.dll",
"ref/netcoreapp2.1/System.Runtime.xml",
"ref/netcoreapp2.1/System.Security.Claims.dll",
"ref/netcoreapp2.1/System.Security.Claims.xml",
"ref/netcoreapp2.1/System.Security.Cryptography.Algorithms.dll",
"ref/netcoreapp2.1/System.Security.Cryptography.Algorithms.xml",
"ref/netcoreapp2.1/System.Security.Cryptography.Csp.dll",
"ref/netcoreapp2.1/System.Security.Cryptography.Csp.xml",
"ref/netcoreapp2.1/System.Security.Cryptography.Encoding.dll",
"ref/netcoreapp2.1/System.Security.Cryptography.Encoding.xml",
"ref/netcoreapp2.1/System.Security.Cryptography.Primitives.dll",
"ref/netcoreapp2.1/System.Security.Cryptography.Primitives.xml",
"ref/netcoreapp2.1/System.Security.Cryptography.X509Certificates.dll",
"ref/netcoreapp2.1/System.Security.Cryptography.X509Certificates.xml",
"ref/netcoreapp2.1/System.Security.Principal.dll",
"ref/netcoreapp2.1/System.Security.Principal.xml",
"ref/netcoreapp2.1/System.Security.SecureString.dll",
"ref/netcoreapp2.1/System.Security.dll",
"ref/netcoreapp2.1/System.ServiceModel.Web.dll",
"ref/netcoreapp2.1/System.ServiceProcess.dll",
"ref/netcoreapp2.1/System.Text.Encoding.Extensions.dll",
"ref/netcoreapp2.1/System.Text.Encoding.Extensions.xml",
"ref/netcoreapp2.1/System.Text.Encoding.dll",
"ref/netcoreapp2.1/System.Text.RegularExpressions.dll",
"ref/netcoreapp2.1/System.Text.RegularExpressions.xml",
"ref/netcoreapp2.1/System.Threading.Overlapped.dll",
"ref/netcoreapp2.1/System.Threading.Overlapped.xml",
"ref/netcoreapp2.1/System.Threading.Tasks.Dataflow.dll",
"ref/netcoreapp2.1/System.Threading.Tasks.Dataflow.xml",
"ref/netcoreapp2.1/System.Threading.Tasks.Extensions.dll",
"ref/netcoreapp2.1/System.Threading.Tasks.Extensions.xml",
"ref/netcoreapp2.1/System.Threading.Tasks.Parallel.dll",
"ref/netcoreapp2.1/System.Threading.Tasks.Parallel.xml",
"ref/netcoreapp2.1/System.Threading.Tasks.dll",
"ref/netcoreapp2.1/System.Threading.Tasks.xml",
"ref/netcoreapp2.1/System.Threading.Thread.dll",
"ref/netcoreapp2.1/System.Threading.Thread.xml",
"ref/netcoreapp2.1/System.Threading.ThreadPool.dll",
"ref/netcoreapp2.1/System.Threading.ThreadPool.xml",
"ref/netcoreapp2.1/System.Threading.Timer.dll",
"ref/netcoreapp2.1/System.Threading.Timer.xml",
"ref/netcoreapp2.1/System.Threading.dll",
"ref/netcoreapp2.1/System.Threading.xml",
"ref/netcoreapp2.1/System.Transactions.Local.dll",
"ref/netcoreapp2.1/System.Transactions.Local.xml",
"ref/netcoreapp2.1/System.Transactions.dll",
"ref/netcoreapp2.1/System.ValueTuple.dll",
"ref/netcoreapp2.1/System.Web.HttpUtility.dll",
"ref/netcoreapp2.1/System.Web.HttpUtility.xml",
"ref/netcoreapp2.1/System.Web.dll",
"ref/netcoreapp2.1/System.Windows.dll",
"ref/netcoreapp2.1/System.Xml.Linq.dll",
"ref/netcoreapp2.1/System.Xml.ReaderWriter.dll",
"ref/netcoreapp2.1/System.Xml.ReaderWriter.xml",
"ref/netcoreapp2.1/System.Xml.Serialization.dll",
"ref/netcoreapp2.1/System.Xml.XDocument.dll",
"ref/netcoreapp2.1/System.Xml.XDocument.xml",
"ref/netcoreapp2.1/System.Xml.XPath.XDocument.dll",
"ref/netcoreapp2.1/System.Xml.XPath.XDocument.xml",
"ref/netcoreapp2.1/System.Xml.XPath.dll",
"ref/netcoreapp2.1/System.Xml.XPath.xml",
"ref/netcoreapp2.1/System.Xml.XmlDocument.dll",
"ref/netcoreapp2.1/System.Xml.XmlSerializer.dll",
"ref/netcoreapp2.1/System.Xml.XmlSerializer.xml",
"ref/netcoreapp2.1/System.Xml.dll",
"ref/netcoreapp2.1/System.dll",
"ref/netcoreapp2.1/WindowsBase.dll",
"ref/netcoreapp2.1/mscorlib.dll",
"ref/netcoreapp2.1/netstandard.dll",
"runtime.json"
]
},
"Microsoft.NETCore.DotNetAppHost/2.1.0": {
"sha512": "f/47I60Wg3SrveTvnecCQhCZCAMYlUujWF15EQ/AZTqF/54qeEJjbCIAxKcZI8ToUYzSg6JdfrHggsgjCyCE9Q==",
"type": "package",
"path": "microsoft.netcore.dotnetapphost/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"microsoft.netcore.dotnetapphost.2.1.0.nupkg.sha512",
"microsoft.netcore.dotnetapphost.nuspec",
"runtime.json"
]
},
"Microsoft.NETCore.DotNetHostPolicy/2.1.0": {
"sha512": "p50yZYKzhH64lmArJgoKjtvsNehECa+/sAuOQzZh5uDNBTbRKxjN8IXP1e517xdVsgrFcSNxSEVDKZIOWVjGcQ==",
"type": "package",
"path": "microsoft.netcore.dotnethostpolicy/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"microsoft.netcore.dotnethostpolicy.2.1.0.nupkg.sha512",
"microsoft.netcore.dotnethostpolicy.nuspec",
"runtime.json"
]
},
"Microsoft.NETCore.DotNetHostResolver/2.1.0": {
"sha512": "fS9D8a+y55n6mHMbNqgHXaPGkjmpVH9h97OyrBxsCuo3Z8aQaFMJ5xIfmzji2ntUd/3truhMbSgSfIelHOkQpg==",
"type": "package",
"path": "microsoft.netcore.dotnethostresolver/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"microsoft.netcore.dotnethostresolver.2.1.0.nupkg.sha512",
"microsoft.netcore.dotnethostresolver.nuspec",
"runtime.json"
]
},
"Microsoft.NETCore.Platforms/2.1.0": {
"sha512": "TT+QCi9LcxGTjBssH7S7n5+8DVcwfG4DYgXX7Dk7+BfZ4oVHj8Q0CbYk9glzAlHLsSt3bYzol+fOdra2iu6GOw==",
"type": "package",
"path": "microsoft.netcore.platforms/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/netstandard1.0/_._",
"microsoft.netcore.platforms.2.1.0.nupkg.sha512",
"microsoft.netcore.platforms.nuspec",
"runtime.json",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"Microsoft.NETCore.Targets/2.1.0": {
"sha512": "etaYwrLZQUS+b3UWTpCnUggd6SQ/ZIkZ5pHnoR7+dIWt/wp2Rv3CvMKOZISsrt7FYCHKwCxfcepuuyEWkQxADg==",
"type": "package",
"path": "microsoft.netcore.targets/2.1.0",
"files": [
".signature.p7s",
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"lib/netstandard1.0/_._",
"microsoft.netcore.targets.2.1.0.nupkg.sha512",
"microsoft.netcore.targets.nuspec",
"runtime.json",
"useSharedDesignerContext.txt",
"version.txt"
]
},
"NETStandard.Library/2.0.3": {
"sha512": "st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
"type": "package",
"path": "netstandard.library/2.0.3",
"files": [
"LICENSE.TXT",
"THIRD-PARTY-NOTICES.TXT",
"build/netstandard2.0/NETStandard.Library.targets",
"build/netstandard2.0/ref/Microsoft.Win32.Primitives.dll",
"build/netstandard2.0/ref/System.AppContext.dll",
"build/netstandard2.0/ref/System.Collections.Concurrent.dll",
"build/netstandard2.0/ref/System.Collections.NonGeneric.dll",
"build/netstandard2.0/ref/System.Collections.Specialized.dll",
"build/netstandard2.0/ref/System.Collections.dll",
"build/netstandard2.0/ref/System.ComponentModel.Composition.dll",
"build/netstandard2.0/ref/System.ComponentModel.EventBasedAsync.dll",
"build/netstandard2.0/ref/System.ComponentModel.Primitives.dll",
"build/netstandard2.0/ref/System.ComponentModel.TypeConverter.dll",
"build/netstandard2.0/ref/System.ComponentModel.dll",
"build/netstandard2.0/ref/System.Console.dll",
"build/netstandard2.0/ref/System.Core.dll",
"build/netstandard2.0/ref/System.Data.Common.dll",
"build/netstandard2.0/ref/System.Data.dll",
"build/netstandard2.0/ref/System.Diagnostics.Contracts.dll",
"build/netstandard2.0/ref/System.Diagnostics.Debug.dll",
"build/netstandard2.0/ref/System.Diagnostics.FileVersionInfo.dll",
"build/netstandard2.0/ref/System.Diagnostics.Process.dll",
"build/netstandard2.0/ref/System.Diagnostics.StackTrace.dll",
"build/netstandard2.0/ref/System.Diagnostics.TextWriterTraceListener.dll",
"build/netstandard2.0/ref/System.Diagnostics.Tools.dll",
"build/netstandard2.0/ref/System.Diagnostics.TraceSource.dll",
"build/netstandard2.0/ref/System.Diagnostics.Tracing.dll",
"build/netstandard2.0/ref/System.Drawing.Primitives.dll",
"build/netstandard2.0/ref/System.Drawing.dll",
"build/netstandard2.0/ref/System.Dynamic.Runtime.dll",
"build/netstandard2.0/ref/System.Globalization.Calendars.dll",
"build/netstandard2.0/ref/System.Globalization.Extensions.dll",
"build/netstandard2.0/ref/System.Globalization.dll",
"build/netstandard2.0/ref/System.IO.Compression.FileSystem.dll",
"build/netstandard2.0/ref/System.IO.Compression.ZipFile.dll",
"build/netstandard2.0/ref/System.IO.Compression.dll",
"build/netstandard2.0/ref/System.IO.FileSystem.DriveInfo.dll",
"build/netstandard2.0/ref/System.IO.FileSystem.Primitives.dll",
"build/netstandard2.0/ref/System.IO.FileSystem.Watcher.dll",
"build/netstandard2.0/ref/System.IO.FileSystem.dll",
"build/netstandard2.0/ref/System.IO.IsolatedStorage.dll",
"build/netstandard2.0/ref/System.IO.MemoryMappedFiles.dll",
"build/netstandard2.0/ref/System.IO.Pipes.dll",
"build/netstandard2.0/ref/System.IO.UnmanagedMemoryStream.dll",
"build/netstandard2.0/ref/System.IO.dll",
"build/netstandard2.0/ref/System.Linq.Expressions.dll",
"build/netstandard2.0/ref/System.Linq.Parallel.dll",
"build/netstandard2.0/ref/System.Linq.Queryable.dll",
"build/netstandard2.0/ref/System.Linq.dll",
"build/netstandard2.0/ref/System.Net.Http.dll",
"build/netstandard2.0/ref/System.Net.NameResolution.dll",
"build/netstandard2.0/ref/System.Net.NetworkInformation.dll",
"build/netstandard2.0/ref/System.Net.Ping.dll",
"build/netstandard2.0/ref/System.Net.Primitives.dll",
"build/netstandard2.0/ref/System.Net.Requests.dll",
"build/netstandard2.0/ref/System.Net.Security.dll",
"build/netstandard2.0/ref/System.Net.Sockets.dll",
"build/netstandard2.0/ref/System.Net.WebHeaderCollection.dll",
"build/netstandard2.0/ref/System.Net.WebSockets.Client.dll",
"build/netstandard2.0/ref/System.Net.WebSockets.dll",
"build/netstandard2.0/ref/System.Net.dll",
"build/netstandard2.0/ref/System.Numerics.dll",
"build/netstandard2.0/ref/System.ObjectModel.dll",
"build/netstandard2.0/ref/System.Reflection.Extensions.dll",
"build/netstandard2.0/ref/System.Reflection.Primitives.dll",
"build/netstandard2.0/ref/System.Reflection.dll",
"build/netstandard2.0/ref/System.Resources.Reader.dll",
"build/netstandard2.0/ref/System.Resources.ResourceManager.dll",
"build/netstandard2.0/ref/System.Resources.Writer.dll",
"build/netstandard2.0/ref/System.Runtime.CompilerServices.VisualC.dll",
"build/netstandard2.0/ref/System.Runtime.Extensions.dll",
"build/netstandard2.0/ref/System.Runtime.Handles.dll",
"build/netstandard2.0/ref/System.Runtime.InteropServices.RuntimeInformation.dll",
"build/netstandard2.0/ref/System.Runtime.InteropServices.dll",
"build/netstandard2.0/ref/System.Runtime.Numerics.dll",
"build/netstandard2.0/ref/System.Runtime.Serialization.Formatters.dll",
"build/netstandard2.0/ref/System.Runtime.Serialization.Json.dll",
"build/netstandard2.0/ref/System.Runtime.Serialization.Primitives.dll",
"build/netstandard2.0/ref/System.Runtime.Serialization.Xml.dll",
"build/netstandard2.0/ref/System.Runtime.Serialization.dll",
"build/netstandard2.0/ref/System.Runtime.dll",
"build/netstandard2.0/ref/System.Security.Claims.dll",
"build/netstandard2.0/ref/System.Security.Cryptography.Algorithms.dll",
"build/netstandard2.0/ref/System.Security.Cryptography.Csp.dll",
"build/netstandard2.0/ref/System.Security.Cryptography.Encoding.dll",
"build/netstandard2.0/ref/System.Security.Cryptography.Primitives.dll",
"build/netstandard2.0/ref/System.Security.Cryptography.X509Certificates.dll",
"build/netstandard2.0/ref/System.Security.Principal.dll",
"build/netstandard2.0/ref/System.Security.SecureString.dll",
"build/netstandard2.0/ref/System.ServiceModel.Web.dll",
"build/netstandard2.0/ref/System.Text.Encoding.Extensions.dll",
"build/netstandard2.0/ref/System.Text.Encoding.dll",
"build/netstandard2.0/ref/System.Text.RegularExpressions.dll",
"build/netstandard2.0/ref/System.Threading.Overlapped.dll",
"build/netstandard2.0/ref/System.Threading.Tasks.Parallel.dll",
"build/netstandard2.0/ref/System.Threading.Tasks.dll",
"build/netstandard2.0/ref/System.Threading.Thread.dll",
"build/netstandard2.0/ref/System.Threading.ThreadPool.dll",
"build/netstandard2.0/ref/System.Threading.Timer.dll",
"build/netstandard2.0/ref/System.Threading.dll",
"build/netstandard2.0/ref/System.Transactions.dll",
"build/netstandard2.0/ref/System.ValueTuple.dll",
"build/netstandard2.0/ref/System.Web.dll",
"build/netstandard2.0/ref/System.Windows.dll",
"build/netstandard2.0/ref/System.Xml.Linq.dll",
"build/netstandard2.0/ref/System.Xml.ReaderWriter.dll",
"build/netstandard2.0/ref/System.Xml.Serialization.dll",
"build/netstandard2.0/ref/System.Xml.XDocument.dll",
"build/netstandard2.0/ref/System.Xml.XPath.XDocument.dll",
"build/netstandard2.0/ref/System.Xml.XPath.dll",
"build/netstandard2.0/ref/System.Xml.XmlDocument.dll",
"build/netstandard2.0/ref/System.Xml.XmlSerializer.dll",
"build/netstandard2.0/ref/System.Xml.dll",
"build/netstandard2.0/ref/System.dll",
"build/netstandard2.0/ref/mscorlib.dll",
"build/netstandard2.0/ref/netstandard.dll",
"build/netstandard2.0/ref/netstandard.xml",
"lib/netstandard1.0/_._",
"netstandard.library.2.0.3.nupkg.sha512",
"netstandard.library.nuspec"
]
}
},
"projectFileDependencyGroups": {
".NETCoreApp,Version=v2.1": [
"Microsoft.NETCore.App >= 2.1.0"
]
},
"packageFolders": {
"C:\\Users\\admin\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\smallproject\\14.java转C#\\TestC\\TestHttpClientGH\\TestHttpClientGH.csproj",
"projectName": "TestHttpClientGH",
"projectPath": "D:\\smallproject\\14.java转C#\\TestC\\TestHttpClientGH\\TestHttpClientGH.csproj",
"packagesPath": "C:\\Users\\admin\\.nuget\\packages\\",
"outputPath": "D:\\smallproject\\14.java转C#\\TestC\\TestHttpClientGH\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\admin\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp2.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://nuget.cdn.azure.cn/v3/index.json": {},
"https://www.nuget.org/api/v2/": {}
},
"frameworks": {
"netcoreapp2.1": {
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"netcoreapp2.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"suppressParent": "All",
"target": "Package",
"version": "[2.1.0, )",
"autoReferenced": true
}
},
"imports": [
"net461"
],
"assetTargetFallback": true,
"warn": true
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="GH_ESBFinder" connectionString="enpoint=http://113.16.174.140:8024/finder;appid=Mys77mkOyevOXMx0;secret=f00f8f8ea15e5d314d4ccb419c2e176d;crt=ESBFinder_SDK.crt;" />
</connectionStrings>
</configuration>
\ No newline at end of file
using System;
using System;
using System.Text;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Linq;
using System.Threading.Tasks;
using System.Threading;
namespace UnitTestProject1
{
/// <summary>
/// UnitTest2 的摘要说明
/// </summary>
[TestClass]
public class UnitTest2
{
public UnitTest2()
{
//
//TODO: 在此处添加构造函数逻辑
//
}
private TestContext testContextInstance;
/// <summary>
///获取或设置测试上下文,该上下文提供
///有关当前测试运行及其功能的信息。
///</summary>
public TestContext TestContext
{
get
{
return testContextInstance;
}
set
{
testContextInstance = value;
}
}
#region 附加测试特性
//
// 编写测试时,可以使用以下附加特性:
//
// 在运行类中的第一个测试之前使用 ClassInitialize 运行代码
// [ClassInitialize()]
// public static void MyClassInitialize(TestContext testContext) { }
//
// 在类中的所有测试都已运行之后使用 ClassCleanup 运行代码
// [ClassCleanup()]
// public static void MyClassCleanup() { }
//
// 在运行每个测试之前,使用 TestInitialize 来运行代码
// [TestInitialize()]
// public void MyTestInitialize() { }
//
// 在每个测试运行完之后,使用 TestCleanup 来运行代码
// [TestCleanup()]
// public void MyTestCleanup() { }
//
#endregion
[TestMethod]
public void TestMethod1()
{
String cmd = "mallintf.getProdAction";
//JObject parameters = new JObject();
//parameters["page"] = "1";
//parameters["size"] = "10";
Dictionary<string, object> dic = new Dictionary<string, object>();
dic.Add("page", "1");
dic.Add("size", "10");
//GHHttpClient.ESBFinder.mulresetEvent.WaitOne();
/**
* 3:发起请求,获取返回
*/
GHHttpClient.ESBFinder.Instance.authAndGetToken();
String resp = GHHttpClient.ESBFinder.Instance.sendRequest(cmd, dic);
Parallel.For(1,10000 , x=>{
int k = x;
GHHttpClient.ESBFinder.Instance.authAndGetToken();
});
/**
* 2: 设定接口参数
*/
//String cmd = "moni.getStockAction";
//JObject parameters = new JObject();
//parameters["username"] = "00000";
//parameters["password"] = "11111";
//String cmd = "mallintf.getProdAction";
//JObject parameters = new JObject();
//parameters["page"] = "1";
//parameters["size"] = "10";
///**
// * 3:发起请求,获取返回
// */
//String resp = client.sendRequest(cmd, parameters);
Console.ReadLine();
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
......@@ -53,14 +53,20 @@
<ItemGroup>
<Compile Include="UnitTest1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UnitTest2.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="ESBFinder_SDK.crt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\GHHttpClient\GHHttpClient.csproj">
<Project>{2b952b48-7ea9-4279-99b5-ca04872e7347}</Project>
<Name>GHHttpClient</Name>
</ProjectReference>
<ProjectReference Include="..\TestC\TestC.csproj">
<Project>{303a6757-1dfd-4a85-9129-feb6441cee7e}</Project>
<Name>TestC</Name>
......
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<connectionStrings>
<add name="GH_ESBFinder" connectionString="enpoint=http://113.16.174.140:8024/finder;appid=Mys77mkOyevOXMx0;secret=f00f8f8ea15e5d314d4ccb419c2e176d;crt=ESBFinder_SDK.crt;" />
</connectionStrings>
</configuration>
\ No newline at end of file
5d1da53fd87bed8ffb1d0cf9a79482807c80d01f
61e8d29aa0fb1f97250dfff59b2705865e8cbe78
5d1da53fd87bed8ffb1d0cf9a79482807c80d01f
61e8d29aa0fb1f97250dfff59b2705865e8cbe78
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
......@@ -22,3 +22,6 @@ D:\smallproject\14.java转C#\TestC\UnitTestProject1\obj\Debug\UnitTestProject1.d
D:\smallproject\14.java转C#\TestC\UnitTestProject1\obj\Debug\UnitTestProject1.pdb
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\ESBFinder_SDK.crt
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\BouncyCastle.Crypto.dll
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\UnitTestProject1.dll.config
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\GHHttpClient.dll
D:\smallproject\14.java转C#\TestC\UnitTestProject1\bin\Debug\GHHttpClient.pdb
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment