我编写了代码来发送一封带有 URL 链接的电子邮件,用户必须单击该链接才能确认。
\n\n\n\n但是当用户单击该链接时,它会在浏览器中打开,但显示以下错误。
\n\n\n\n\n“缓冲区不能为空。参数名称:缓冲区”
\n\n请在下面找到堆栈跟踪:
\n
[ArgumentNullException: Buffer cannot be null.\n Parameter name: buffer]\n System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable) +9629927\n System.IO.MemoryStream..ctor(Byte[] buffer) +6\n Auth.IdentityTokenXChangeData.Deserialize(String base64Package) +187\n Auth.IdentityTokenXChange.TrySniffIdentityToken(HttpRequest req, String& sessionId, String& sessionTag, String& returnUrl) +244\n Auth.IdentityModule.OnBeginRequest(Object sender, EventArgs e) +365\n System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +220\n System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +120`\nRun Code Online (Sandbox Code Playgroud)\n\n这耗尽了我的一天。任何建议都会有很大帮助。
\n\n找到了有关错误的线索..\n我相信问题出在查询字符串中的编码值
\n\n("F960866879F669E=Tw5NpFeW9HsAqc_Ap5dmOwqkZ041pFQGYLxRV-puumtHsfhrTYtDe51uCbGV44Kc1X3n6cggsynfqRmh74ie535ymkvATeK5Jii11tOMIZDZ_GVB8QolLe\xe2\x80\x8c\xe2\x80\x8bMU5i6KWEZculKhM0IOhYFaMc-DsB") - \nRun Code Online (Sandbox Code Playgroud)\n\n由于某些原因,Base64 解码返回“null”。
\n\nMethod -\n\'System.Web.HttpServerUtility.UrlTokenDecode\n("F960866879F669E=Tw5NpFeW9HsAqc_Ap5dmOwqkZ041pFQGYLxRV-puumtHsfhrTYtDe51uCbGV44Kc1X3n6cggsynfqRmh74ie535ymkvATeK5Jii11tOMIZDZ_GVB8QolLe\xe2\x80\x8c\xe2\x80\x8bMU5i6KWEZculKhM0IOhYFaMc-DsB")\'\nRun Code Online (Sandbox Code Playgroud)\n\n知道为什么它返回 null 吗?它不是有效的 Base64 编码吗?
\n我可以看到这个operator | =在我的项目中的一些示例代码中使用.确切的代码如下
DocumentRetrievalOptions docRetrievalOptions = DocumentRetrievalOptions.ByTargetJurisdiction;
docRetrievalOptions |= DocumentRetrievalOptions.ByUniqueId;
Run Code Online (Sandbox Code Playgroud)
其中'DocumentRetrievalOptions'的类型为枚举.
如果有人告诉我,这意味着什么,这将是非常有帮助的.
我正在尝试为护照号码实施正则表达式验证.
我的要求是
我尝试使用下面的正则表达式
^(?0 {3,20})[A-ZA-Z0-9] {3,20} $
这似乎适用于大多数情况,但是如果我的文本包含3个或更多前导零,它似乎失败了.如'00000001'.
示例匹配
任何帮助将非常感激.