提交当前本机整理版本
This commit is contained in:
@@ -62,4 +62,28 @@ namespace Lskj.IPersonnelConnection
|
||||
/// <summary>
|
||||
/// CDSBLims加密
|
||||
/// </summary>
|
||||
/// <param name="Url"></
|
||||
/// <param name="Url"></param>
|
||||
/// <param name="CDSBLimsPrivateKey"></param>
|
||||
/// <returns></returns>
|
||||
public static string CDSBLimsUrlEncryption(string Url, string LoginNo, string CDSBLimsPrivateKey)
|
||||
{
|
||||
if (Url.Contains("{CDSBLimsLoginNo}"))
|
||||
{
|
||||
var aes = Aes.Create();
|
||||
aes.Key = Encoding.UTF8.GetBytes(CDSBLimsPrivateKey);
|
||||
aes.GenerateIV();
|
||||
var encryptor = aes.CreateEncryptor(aes.Key, aes.IV);
|
||||
var ms = new MemoryStream();
|
||||
ms.Write(aes.IV, 0, aes.IV.Length);
|
||||
using (var cs = new CryptoStream(ms, encryptor, CryptoStreamMode.Write))
|
||||
using (var sw = new StreamWriter(cs, Encoding.UTF8))
|
||||
{
|
||||
sw.Write(LoginNo);
|
||||
}
|
||||
//替换许可
|
||||
Url = Url.Replace("{CDSBLimsLoginNo}", Convert.ToBase64String(ms.ToArray()));
|
||||
}
|
||||
return Url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user