SqlConnectionStringBuilder.PersistSecurityInfo 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示在连接处于打开状态后,是否应返回安全敏感信息(如密码或访问令牌)作为 SqlConnectionStringBuilder 连接字符串的一部分。
public:
property bool PersistSecurityInfo { bool get(); void set(bool value); };
public bool PersistSecurityInfo { get; set; }
member this.PersistSecurityInfo : bool with get, set
Public Property PersistSecurityInfo As Boolean
属性值
如果安全敏感信息应作为连接字符串的一部分返回,true;否则,false。 默认值为 false。
注解
此属性对应于连接字符串中的“持久安全信息”和“persistsecurityinfo”键。
注释
仅当应用程序需要从已打开的数据库连接中读取密码时,才应将此属性设置为 true 该属性。 默认值 false 为更安全的设置。 使用 true 此属性可打开应用程序,以面临安全风险,例如意外记录或跟踪数据库密码。