【发布时间】:2021-11-23 14:07:25
【问题描述】:
你好我有以下缺点,原来在我的代码中我有以下:
private void CreatePasswordCreate(string password, out byte[] passwordCreate, out byte[] passwordRepeat) {
using (var hmac = new System.Security.Cryptography.HMACSHA512())
{
passwordCreate = hmac.Key;
passwordRepeat = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password));
}
}
但是在写它的时候我得到了以下错误:
CS0234:命名空间“System.Invoices.System”中不存在类型或命名空间名称“Security”(您是否缺少程序集引用?)
在我看来,之前显示的内容出现在以下代码行中,特别是“安全”一词
using (var hmac = new System.Security.Crytography.HMACSHA512())
我也收到以下错误:
CS0234:命名空间“System.Invoices.System”中不存在类型或命名空间名称“Text”(您是否缺少程序集引用?)
我在以下代码行中收到此错误:
passwordRepeat = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password));
我不知道如何导入这个库,因为我是这个库的新手,我想知道如何添加这个库或者“安全”和“文本”类应该有什么内容,以及它应该去哪里它是不是因为它没有自动出现而被创建的?
using System
【问题讨论】:
-
你熟悉 nuget 吗?作为一个新手并不丢人。但我不会从与安全相关的开发开始。
-
是的,但如果我现在不开始,什么时候开始?如果没有,我永远不会学习,我来这里寻求解决方案,而不是让他们让我回到开始,帮助不会教我一个坏习惯