这是我的des解密代码。我不知道为什么它在CopyTo函数上显示错误。
Private Function Unsecure(ByVal sInput As Byte(), ByVal sKey As String)
'Define the service provider
Dim DES As New DESCryptoServiceProvider()
DES.Key() = ASCIIEncoding.ASCII.GetBytes(sKey)
DES.IV = ASCIIEncoding.ASCII.GetBytes(sKey)
'Define the crypto transformer
Dim cryptoTransform As ICryptoTransform
cryptoTransform = DES.CreateDecryptor
Dim ms As New MemoryStream(sInput)
Dim cryptostream As New CryptoStream(ms, cryptoTransform, CryptoStreamMode.Read)
Dim ms1 As New MemoryStream()
cryptostream.CopyTo(ms1) '// <- **Error: CopyTo is not a member of System.Security.Cryptography.Cryptostream**
Return ms1.ToArray()
End Function