第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

Base-64 char數(shù)組的長(zhǎng)度無(wú)效

Base-64 char數(shù)組的長(zhǎng)度無(wú)效

鴻蒙傳說(shuō) 2019-10-17 14:55:16
如標(biāo)題所示,我得到:Base-64 char數(shù)組的長(zhǎng)度無(wú)效。我在這里已經(jīng)閱讀了有關(guān)此問(wèn)題的信息,似乎建議是將ViewState如果較大則存儲(chǔ)在SQL中。我正在使用具有大量數(shù)據(jù)收集功能的向?qū)?,因此我的ViewState很大。但是,在我轉(zhuǎn)向“數(shù)據(jù)庫(kù)存儲(chǔ)”解決方案之前,也許有人可以看看并告訴我是否還有其他選擇?我使用以下方法構(gòu)造要發(fā)送的電子郵件:public void SendEmailAddressVerificationEmail(string userName, string to){    string msg = "Please click on the link below or paste it into a browser to verify your email account.<BR><BR>" +                    "<a href=\"" + _configuration.RootURL + "Accounts/VerifyEmail.aspx?a=" +                    userName.Encrypt("verify") + "\">" +                    _configuration.RootURL + "Accounts/VerifyEmail.aspx?a=" +                    userName.Encrypt("verify") + "</a>";    SendEmail(to, "", "", "Account created! Email verification required.", msg);}Encrypt方法如下所示:public static string Encrypt(string clearText, string Password){    byte[] clearBytes = System.Text.Encoding.Unicode.GetBytes(clearText);    PasswordDeriveBytes pdb = new PasswordDeriveBytes(Password, new byte[] { 0x49, 0x76, 0x61, 0x6e, 0x20, 0x4d, 0x65, 0x64, 0x76, 0x65, 0x64, 0x65, 0x76 });    byte[] encryptedData = Encrypt(clearBytes, pdb.GetBytes(32), pdb.GetBytes(16));    return Convert.ToBase64String(encryptedData);}這是Hotmail中的HTML外觀:請(qǐng)單擊下面的鏈接或?qū)⑵湔迟N到瀏覽器中以驗(yàn)證您的電子郵件帳戶(hù)。http:// localhost:1563 / Accounts / VerifyEmail.aspx?a = YOHY57xYRENEOu3H + FGq1Rf09AZAI56EPjfwuK8XWKg =在接收端,VerifyEmail.aspx.cs頁(yè)面的行如下: string username = Cryptography.Decrypt(_webContext.UserNameToVerify, "verify");這是UserNameToVerify的獲取方法:public string UserNameToVerify{    get    {        return GetQueryStringValue("a").ToString();    }}這是GetQueryStringValue方法:private static string GetQueryStringValue(string key){    return HttpContext.Current.Request.QueryString.Get(key);}解密方法如下所示:public static string Decrypt(string cipherText, string password){    **// THE ERROR IS THROWN HERE!!**    byte[] cipherBytes = Convert.FromBase64String(cipherText);可以通過(guò)代碼修復(fù)糾正此錯(cuò)誤,還是必須將ViewState存儲(chǔ)在數(shù)據(jù)庫(kù)中?
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 718 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)