|
@@ -5,6 +5,7 @@ using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Runtime.InteropServices;
|
|
|
|
+using System.Security.Policy;
|
|
using System.Text;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
@@ -15,9 +16,9 @@ namespace AnHuiMI.Common
|
|
|
|
|
|
|
|
|
|
[DllImport("NationECCode.dll", EntryPoint = "NationEcTrans", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
|
|
[DllImport("NationECCode.dll", EntryPoint = "NationEcTrans", CharSet = CharSet.Ansi, ExactSpelling = false, CallingConvention = CallingConvention.StdCall)]
|
|
- static extern string NationEcTrans(string strUrl,string InData,out string OutData);
|
|
+
|
|
-
|
|
|
|
|
|
|
|
|
|
+ static extern IntPtr NationEcTrans(StringBuilder strUrl, StringBuilder InData, StringBuilder OutData);
|
|
public static string ECQuery(string EcCertDecodeType) {
|
|
public static string ECQuery(string EcCertDecodeType) {
|
|
Random rd = new Random();
|
|
Random rd = new Random();
|
|
int iNum = rd.Next();
|
|
int iNum = rd.Next();
|
|
@@ -94,7 +95,19 @@ namespace AnHuiMI.Common
|
|
input.transType = transType;
|
|
input.transType = transType;
|
|
input.extra = "";
|
|
input.extra = "";
|
|
|
|
|
|
- NationEcTrans(Global.inf.ecURL, JsonHelper.toJsonString(input), out sOutPar);
|
|
+
|
|
|
|
+ StringBuilder sbURL = new StringBuilder(Global.inf.ecURL);
|
|
|
|
+ StringBuilder sbInData = new StringBuilder(JsonHelper.toJsonString(input));
|
|
|
|
+ StringBuilder sbOutData = new StringBuilder(2048);
|
|
|
|
+
|
|
|
|
+ IntPtr pRtn = NationEcTrans(sbURL, sbInData, sbOutData);
|
|
|
|
+ sOutPar = sbOutData.ToString();
|
|
|
|
+ string rtn = Marshal.PtrToStringAnsi(pRtn);
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (JsonHelper.getDestValue(JObject.Parse(sOutPar), "code") != "0")
|
|
if (JsonHelper.getDestValue(JObject.Parse(sOutPar), "code") != "0")
|
|
{
|
|
{
|
|
Global.writeLog("调用认证接口"+transType+"失败:" + sOutPar);
|
|
Global.writeLog("调用认证接口"+transType+"失败:" + sOutPar);
|