Fluent 2021R1 UDF 环境配置:3步修改 udf.bat 适配 VS2019/2022
2026/7/12 15:28:07
在 Windows Phone 开发中,我们可以利用其加密类来显示消息认证码(MAC)。以下是具体的操作步骤:
1.添加命名空间:在页面顶部添加以下using指令:
using System.Security.Cryptography;Generate按钮的点击事件添加处理程序。双击Generate按钮,并在处理程序中粘贴以下代码:string message = txtMessage.Text; string key = txtKey.Text; System.Text.UTF8Encoding encoding = new System.Text.UTF8Encoding(); byte[] keyByte = encoding.GetBytes(key); HMACSHA1 hmacsha1 = new HMACSHA1(keyByte); HMACSHA256 hmacsha256 = new HMACSHA256(keyByte); byte[] messageBytes = encoding.GetBytes(message); byte[]