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" 索引鍵。

注意

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

適用於

另請參閱