1. warning SYSLIB0021: “DESCryptoServiceProvider”已过时:“Derived cryptographic types are obsolete. Use the Create method on the base type instead.”
var des = new DESCryptoServiceProvider(); 修改为:var des = DES.Create();
2. warning SYSLIB0021: MD5CryptoServiceProvider”已过时:“Derived cryptographic types are obsolete. Use the Create method on the base type instead.
MD5 md5 = new MD5CryptoServiceProvider(); 修改为: MD5 md5 = MD5.Create();
3. warning SYSLIB0021: “SHA1Managed”已过时:“Derived cryptographic types are obsolete. Use the Create method on the base type instead.”
var hash = new SHA1Managed(); 替换为: var hash = SHA1.Create(); 其他类似: SHA256.Create(); SHA512.Create();
4. “RNGCryptoServiceProvider”已过时:“RNGCryptoServiceProvider is obsolete. To generate a random number, use one of the RandomNumberGenerator static methods instead.”
RandomNumberGenerator.GetInt32(Int32) RandomNumberGenerator.Create()
5. warning SYSLIB0022: “RijndaelManaged”已过时:“The Rijndael and RijndaelManaged types are obsolete. Use Aes instead.”
var rDel = new RijndaelManaged(); 替换为 var rDel = Aes.Create("AesManaged")
标签:Use,加密,过期,Create,obsolete,warning,instead,var,Net6 From: https://www.cnblogs.com/qingjiawen/p/16775175.html