SqlConnectionStringBuilder.PersistSecurityInfo 屬性

定義

取得或設定值,指出是否應該傳回安全性敏感性資訊,例如密碼或存取令牌,作為與這個 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

備註

此屬性對應於 連接字串 中的「Persist Security Info」與「persistsecurityinfo」鍵。

Note

這個屬性只有在你的應用程式有特定需求需要從已開啟的資料庫連線讀取密碼時才應該設定為 。true 預設值 false 是較安全的設定。 使用此 true 屬性會讓您的應用程式面臨安全風險,例如不小心記錄或追蹤資料庫密碼。

適用於

另請參閱