我可以向 PasswordCredential.Properties 添加自定义属性吗?自定义、属性、PasswordCredential、Properties

2023-09-07 08:42:31 作者:雷锋叔叔戴的是绿帽子i

在 WinRT API 中有 Windows.Security.Credentials 命名空间,其中包含 PasswordCredential 类.使用它,我们可以加密敏感数据,如用户名和密码,但该类本身有一个名为Properties"的属性,在我看来,它就像一个方便的容器,用于存放与存储的凭据相关的其他自定义属性,但我无法让它工作.文档中有属性"的只读"访问类型,但我认为这仅意味着我无法更改对它指向的容器的引用.我的问题是:

In WinRT API there is Windows.Security.Credentials namespace which contains the PasswordCredential class. Using it we can encrypt sensitive data like user names and passwords but the class itself has a property named "Properties" which looks to me like a handy container for other custom properties somehow related to the stored credential but I can't get it to work. There is a "Read-only" access type for the "Properties" in the documentation but I thought that meant only that I can't change the reference to the container it points to. My question is: