任何人都可以告诉我如何从下面的代码中删除所有的CA2202警告? public static byte[] Encrypt(string data, byte[] key, byte[] iv) { using(MemoryStream memoryStream = new MemoryStream()) { using (DESCryptoServiceProvider cryptograph = new DESCryptoServiceProvider()) { using (CryptoStream cryptoStream = new CryptoStream(memoryStream, cryptograph.CreateEncryptor(key, iv), CryptoStreamMode.Write)) { using(StreamWriter streamWriter = new StreamWriter(cryptoStream)) { streamWriter.Write(data); } } } return memoryStream.ToArray(); } } 警告7 CA2202:Microsoft.Usage:Object'cryptoStream'可以在方法CryptoServices.Encrypt(string,byte [],byte [])'中多次使用。 为了避免产生System.ObjectDisposedException,你不应该在一个对象上多次调用Dispose:Lines:34 警告8 CA2202:Microsoft.Usage:Object'memoryStream'可以在方法CryptoServices.Encrypt(string,byte […]