先获取密码:
var shastr = new SHA1CryptoServiceProvider().ComputeHash(new UnicodeEncoding().GetBytes("123456"));
var shabytestr = ByteArrayToHexString(shastr);
private static string ByteArrayToHexString(byte[] buf) { return BitConverter.ToString(buf).Replace("-", ""); }
--修改密码 --参考:https://blog.csdn.net/yuhu1023/article/details/88383119 UPDATE dbo.AccountsUsers SET Password=CONVERT(varbinary(512),0x6ED5833CF35286EBF8662B7B5949F0D742BBEC3F) WHERE UserId=2157 --获取字符串二进制流 --参考:https://www.cnblogs.com/qing-xuanlvyee/articles/4756954.html select convert (varbinary(256),'123456') AS binvalue --将流拼接输出为字符串 DECLARE @binvalue VARBINARY(256), @vcharvalue NVARCHAR(256); SET @binvalue = 0xF5FF3FED3B055DF7EC27251FBC80EE48; SELECT @vcharvalue = N'aa' + master.dbo.fn_varbintohexsubstring(1, @binvalue, 1, 0); PRINT @vcharvalue;
C# string类型和byte[]类型相互转换
https://www.jianshu.com/p/766e12c66db8
C# 获取文件MD5、SHA1
https://www.cnblogs.com/shy1766IT/p/7307142.html
将String转化成Stream,将Stream转换成String, C# Stream 和 byte[] 之间的转换(文件流的应用)
https://www.cnblogs.com/shy1766IT/p/5371755.html