当前上下文中不存在名称“ProtectedData”

时间:2015-02-05 16:40:19

标签: c# security windows-phone-7 windows-phone-8

我正在关注THIS文章,以便在应用中存储安全数据。但是当我使用ProtectedData类时,我得到了这个错误:

The name 'ProtectedData' does not exist in the current context

搜索找到的THIS问题,说明我需要添加对System.Security.dll的引用才能使其正常运行。

我是Windows Phone / C#/ Visual的新手。如何添加该引用?

由于

1 个答案:

答案 0 :(得分:-1)

来自MSDN https://msdn.microsoft.com/en-us/library/hh708954.aspx

  

在C#或Visual Basic项目中添加引用

     
      
  1. 在菜单栏上,选择“文件”,“打开”。
  2.   
  3. 导航到您的解决方案或项目。
  4.   
  5. 在Solution Explorer中,打开项目节点的快捷菜单,然后选择Add Reference。
  6.   
  7. 指定要添加的引用,然后选择“确定”按钮。
  8.   

您将在Assemblies下找到System.Security - >框架。然后你必须在你的班级中添加一个using语句