Questions tagged «fxcop»

12
CA2202,如何解决这种情况
谁能告诉我如何从以下代码中删除所有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。用法:对象“ …
102 c#  .net  code-analysis  fxcop 



9
参数命名:文件名还是文件名?
我在命名*上尽量做到语法正确。我一直用filename代替fileName。Java约定似乎也使用此方法,但FxCop更喜欢fileName。 WikiPedia上对此进行了讨论。我读得越多,我就越觉得自己是对的(这很平常!:))。有人能给出确定的答案吗?还是仅仅是主观的? *我只是希望这篇文章中没有语法错误!


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.