在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 异常详细信息: System.ArgumentOutOfRangeException: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)
[没有相关的源行] 源文件: c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2d1ee80e\52146ed9\App_Web_l4lsnkxq.0.cs 行: 0 堆栈跟踪: [ArgumentOutOfRangeException: 在多字节的目标代码页中,没有此 Unicode 字符可以映射到的字符。 (异常来自 HRESULT:0x80070459)]
System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) +0
System.Web.Hosting.IIS7WorkerRequest.GetServerVariableInternal(String name) +98
System.Web.Hosting.IIS7WorkerRequest.ReadRequestHeaders() +134
System.Web.Hosting.IIS7WorkerRequest.GetKnownRequestHeader(Int32 index) +153
System.Web.HttpRequest.FillInHeadersCollection() +145
System.Web.HttpRequest.get_Headers() +217
System.Web.Configuration.HttpCapabilitiesDefaultProvider.EvaluateFinal(HttpRequest request, Boolean onlyEvaluateUserAgent) +60
System.Web.Configuration.HttpCapabilitiesDefaultProvider.Evaluate(HttpRequest request) +413
System.Web.HttpRequest.get_Browser() +260
System.Web.UI.Page.SetIntrinsics(HttpContext context, Boolean allowAsync) +214
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +19
System.Web.UI.Page.ProcessRequest(HttpContext context) +167
ASP.login_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\2d1ee80e\52146ed9\App_Web_l4lsnkxq.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
请问这是什么原因
HttpCookie cookie = new HttpCookie("username", HttpUtility.UrlEncode(userName));
cookie.Expires = DateTime.Now.AddMonths(1);
Response.AppendCookie(cookie);