どのようにして予期される例外を処理できますか?私の他のSimplerAESクラスで例外を回避するにはどうすればいいですか
u.RowKey == new SimplerAES().Dec(HttpServerUtility.UrlTokenDecode(id)));
:以下呼び出す
私は私のMVCコントローラのコードを持って
public string Dec(byte[] encrypted)
{
return encoder.GetString(Decrypt(encrypted));
}
public byte[] Decrypt(byte[] buffer)
{
try {
MemoryStream decryptStream = new MemoryStream();
using (CryptoStream cs = new CryptoStream(decryptStream, decryptor, CryptoStreamMode.Write))
{
cs.Write(buffer, 0, buffer.Length);
}
return decryptStream.ToArray();
} catch(CryptographicException e){
//... do something with it ...
return null; // I put the return null here as I got a syntax message saying
// not all code returns
}
}
は、誰かが私が失敗した復号化メッセージを取得する方法を説明していただけますすべて私が最初にRowKeyを取得しようとするところまで を上にしてください。 内にu.RowKeyを入れなければならないのですか?