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 會開啟應用程式的安全性風險,例如不小心記錄或追蹤資料庫密碼。

適用於

另請參閱