Share via


SqlConnectionStringBuilder.PersistSecurityInfo 屬性

定義

取得或設定 Boolean 值,指出安全性敏感性資訊,例如密碼或存取權杖,是否應該在連線處於開啟狀態之後,以這個 SqlConnectionStringBuilder 連接建立的連接字串一部分傳回。 只有當您的應用程式有特定需要從已開啟的資料庫連線讀取密碼時,才應該將此屬性設定 true 為 。 的預設值 false 是更安全的設定;針對這個屬性, true 會開啟您的應用程式安全性風險,例如意外記錄或追蹤資料庫密碼。

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

屬性值

PersistSecurityInfo 屬性的值,如未提供任何值,則為 false

備註

此屬性會對應至連接字串內的 "Persist Security Info" 和 "persistsecurityinfo" 索引鍵。

重設連接字串會重設所有連接字串值,包括密碼。

適用於