接收的参数
string encryptedData = Request.QueryString["encryptedData"];
string iv = Request.QueryString["iv"];
string session_key = Request.QueryString["session_key"];
接收到了出错。怎么解决这个呢?
下面是提交过去的参数,
-------------------------------------------------------------
encryptedData: "Tx6KCFvYbdoZ01C19SHXsVemO155JoQmaeJaaaTX5EZkM1lK5UrD3NBrC/6HkZEpC4Jcfw8s5guWcrFB1P+dJ2JEGvo6WI939K7R+vmUxsQRwadChrE3d1yveGcCP6f6A88tHnPq407Chw2h/8ZrZJC7O5gZm/pxbQT33t2yHmpkuboHm7wrl897ZH44ocx2NsD13T4p3I5tAyODUXXHfA=="
iv: "N4jC6bfGPkRUMOA5WNl3AQ=="
session_key: "QNNuDoOyWFBqB5E\/zt0Eqw=="
--------------------------------------------------------
以下出错:
"<!DOCTYPE html>
<html>
<head>
<title>输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。</title>
<meta name="viewport" content="width=device-width" />
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:pointer; }
@media screen and (max-width: 639px) {
pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
}
@media screen and (max-width: 479px) {
pre { width: 280px; }
}
</style>
</head>
<body bgcolor="white">
<span><H1>“/”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>
<h2> <i>输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> 说明: </b>执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
<br><br>
<b> 异常详细信息: </b>System.FormatException: 输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。<br><br>
<b>源错误:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
行 242: byte[] encryData = Convert.FromBase64String(encryptedData);
行 243: RijndaelManaged rijndaelCipher = new RijndaelManaged();
<font color=red>行 244: rijndaelCipher.Key = Convert.FromBase64String(session_key);
</font>行 245: rijndaelCipher.IV = Convert.FromBase64String(iv);
行 246: rijndaelCipher.Mode = CipherMode.CBC;</pre> </code>
</td>
</tr>
</table>
<br>
<b> 源文件: </b> E:\sysXiaoshou\sysXiaoshou\wxapi\getuserinfo.aspx.cs<b> 行: </b> 244
<br><br>
<b>堆栈跟踪:</b> <br><br>
<table width=100% bgcolor="#ffffcc">
<tr>
<td>
<code><pre>
[FormatException: 输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。]
System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength) +6226339
System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength) +147
System.Convert.FromBase64String(String s) +50
sysXiaoshou.wxapi.getuserinfo.getphone_data() in E:\sysXiaoshou\sysXiaoshou\wxapi\getuserinfo.aspx.cs:244
sysXiaoshou.wxapi.getuserinfo.Page_Load(Object sender, EventArgs e) in E:\sysXiaoshou\sysXiaoshou\wxapi\getuserinfo.aspx.cs:35
System.Web.UI.Control.OnLoad(EventArgs e) +108
System.Web.UI.Control.LoadRecursive() +90
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1602
</pre> </code>
</td>
</tr>
</table>
<br>
<hr width=100% size=1 color=silver>
<b>版本信息:</b> Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.8.9206.0
</font>
</body>
</html>
<!--
[FormatException]: 输入的不是有效的 Base-64 字符串,因为它包含非 Base-64 字符、两个以上的填充字符,或者填充字符间包含非法字符。
在 System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
在 System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
在 System.Convert.FromBase64String(String s)
在 sysXiaoshou.wxapi.getuserinfo.getphone_data() 位置 E:\sysXiaoshou\sysXiaoshou\wxapi\getuserinfo.aspx.cs:行号 244
在 sysXiaoshou.wxapi.getuserinfo.Page_Load(Object sender, EventArgs e) 位置 E:\sysXiaoshou\sysXiaoshou\wxapi\getuserinfo.aspx.cs:行号 35
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
[HttpUnhandledException]: 引发类型为“System.Web.HttpUnhandledException”的异常。
在 System.Web.UI.Page.HandleError(Exception e)
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
在 System.Web.UI.Page.ProcessRequest()
在 System.Web.UI.Page.ProcessRequest(HttpContext context)
在 ASP.wxapi_getuserinfo_aspx.ProcessRequest(HttpContext context) 位置 c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\822d7d9d\393e6636\App_Web_2ojkjvay.1.cs:行号 0
在 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
在 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-->"