保护敏感信息

许多应用程序都使用应仅可用于确定用户的数据。 这有些建议,您可以采用以保护 Microsoft 窗体中的敏感信息:

  • Write code that makes a control (and its data) invisible to unauthorized users. Visible 属性使控件可见或不可见。

  • Write code that sets the control's foreground and background to the same color when unauthorized users run the application. This hides the information from unauthorized users. ForeColorBackColor 属性确定前景色背景色

  • Disable the control when unauthorized users run the application. Enabled 属性确定何时禁用控件。

  • Require a password for access to the application or a specific control. 使用 占位符 作为用户键入每个字符。 [PasswordChar] ( (passwordchar-property.md) 属性定义占位符字符。

注意

[!注释] 使用密码或任何所列出的其他技术可以提高应用程序的安全性,但是不能保证能阻止对您的数据的未授权访问。

另请参阅

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。