代码之家  ›  专栏  ›  技术社区  ›  JeffO

用于在系统中的VBA.NET窗体应用程序中存储密码的安全数据类型。设置

  •  0
  • JeffO  · 技术社区  · 15 年前

    需要在windows forms vb.net应用程序中存储外部应用程序的用户名和密码。对于初始测试,我只是将设置类型设置为“Text”,但需要更多的安全性。

    有可用的System.Security和Encryption类型,但不确定从何处开始。如果您对如何添加、更新和删除这些值有任何建议,我们将不胜感激。似乎比纯文本要复杂得多。

    虽然我需要某种程度的安全性,但这并不适用于任何类型的金融或医疗应用。

    Dim config As System.Configuration.Configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
    Dim configSection ConfigurationSection
    configSection = config.ConnectionStrings
    If Not (configSection Is Nothing) Then
        If Not (configSection.ElementInformation.IsLocked) Then
            configSection.SectionInformation.ProtectSection ("DataProtectionConfigurationProvider")
            configSection.SectionInformation.ForceSave = True
            config.Save(ConfigurationSaveMode.Full)
        End If
    End If
    
    3 回复  |  直到 15 年前
        1
  •  0
  •   ikhaldeev    15 年前

    .NET Framework开发人员指南: Cryptographic services

        2
  •  0
  •   Community CDub    8 年前

    决定使用字符串类型,只加密保存的值。对此的回答很有帮助: How to encrypt a string in .NET?

    推荐文章