NetworkInformationPermission.IsUnrestricted 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回值,指出目前的權限是否不受限制。
public:
virtual bool IsUnrestricted();
public bool IsUnrestricted ();
abstract member IsUnrestricted : unit -> bool
override this.IsUnrestricted : unit -> bool
Public Function IsUnrestricted () As Boolean
傳回
如果目前的權限不受限制,則為 true
;否則為 false
。
實作
範例
下列範例會建立許可權物件並顯示其狀態。
System::Net::NetworkInformation::NetworkInformationPermission^ unrestricted = gcnew System::Net::NetworkInformation::NetworkInformationPermission( System::Security::Permissions::PermissionState::Unrestricted );
Console::WriteLine( L"Is unrestricted? {0}", unrestricted->IsUnrestricted() );
System.Net.NetworkInformation.NetworkInformationPermission unrestricted =
new System.Net.NetworkInformation.NetworkInformationPermission(
System.Security.Permissions.PermissionState.Unrestricted);
Console.WriteLine("Is unrestricted? " + unrestricted.IsUnrestricted());
Dim unrestricted As New System.Net.NetworkInformation.NetworkInformationPermission( _
System.Security.Permissions.PermissionState.Unrestricted)
Console.WriteLine("Is unrestricted? " + unrestricted.IsUnrestricted().ToString())
備註
使用建構函式建立 NetworkInformationPermission 不受限制的許可權。