共用方式為


SqlClientPermission 建構函式

定義

多載

SqlClientPermission()
已淘汰.

初始化 SqlClientPermission 類別的新執行個體。

SqlClientPermission(PermissionState)

初始化 SqlClientPermission 類別的新執行個體。

SqlClientPermission(PermissionState, Boolean)
已淘汰.

初始化 SqlClientPermission 類別的新執行個體。

SqlClientPermission()

警告

SqlClientPermission() has been deprecated. Use the SqlClientPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202

初始化 SqlClientPermission 類別的新執行個體。

public:
 SqlClientPermission();
[System.Obsolete("SqlClientPermission() has been deprecated.  Use the SqlClientPermission(PermissionState.None) constructor.  http://go.microsoft.com/fwlink/?linkid=14202", true)]
public SqlClientPermission ();
Public Sub New ()
屬性

適用於

SqlClientPermission(PermissionState)

初始化 SqlClientPermission 類別的新執行個體。

public:
 SqlClientPermission(System::Security::Permissions::PermissionState state);
public SqlClientPermission (System.Security.Permissions.PermissionState state);
new Microsoft.Data.SqlClient.SqlClientPermission : System.Security.Permissions.PermissionState -> Microsoft.Data.SqlClient.SqlClientPermission
Public Sub New (state As PermissionState)

參數

state
PermissionState

其中一個 PermissionState 值。

適用於

SqlClientPermission(PermissionState, Boolean)

警告

SqlClientPermission(PermissionState state, Boolean allowBlankPassword) has been deprecated. Use the SqlClientPermission(PermissionState.None) constructor. http://go.microsoft.com/fwlink/?linkid=14202

初始化 SqlClientPermission 類別的新執行個體。

public:
 SqlClientPermission(System::Security::Permissions::PermissionState state, bool allowBlankPassword);
[System.Obsolete("SqlClientPermission(PermissionState state, Boolean allowBlankPassword) has been deprecated.  Use the SqlClientPermission(PermissionState.None) constructor.  http://go.microsoft.com/fwlink/?linkid=14202", true)]
public SqlClientPermission (System.Security.Permissions.PermissionState state, bool allowBlankPassword);
[<System.Obsolete("SqlClientPermission(PermissionState state, Boolean allowBlankPassword) has been deprecated.  Use the SqlClientPermission(PermissionState.None) constructor.  http://go.microsoft.com/fwlink/?linkid=14202", true)>]
new Microsoft.Data.SqlClient.SqlClientPermission : System.Security.Permissions.PermissionState * bool -> Microsoft.Data.SqlClient.SqlClientPermission
Public Sub New (state As PermissionState, allowBlankPassword As Boolean)

參數

state
PermissionState

其中一個 PermissionState 值。

allowBlankPassword
Boolean

指出是否允許空白密碼。

屬性

備註

列舉 PermissionState 的優先順序高於 AllowBlankPassword 屬性。 因此,如果您設定 AllowBlankPasswordfalse ,您也必須設定 PermissionStateNone 為 ,以防止使用者使用空白密碼建立連線。 如需示範如何使用安全性需求的範例,請參閱 代碼存取安全性和 ADO.NET

適用於