SocketPermissionAttribute Třída
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Upozornění
Code Access Security is not supported or honored by the runtime.
Určuje akce zabezpečení pro řízení Socket připojení. Tuto třídu nelze zdědit.
public ref class SocketPermissionAttribute sealed : System::Security::Permissions::CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
public sealed class SocketPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
public sealed class SocketPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)]
[System.Serializable]
public sealed class SocketPermissionAttribute : System.Security.Permissions.CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
type SocketPermissionAttribute = class
inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Obsolete("Code Access Security is not supported or honored by the runtime.", DiagnosticId="SYSLIB0003", UrlFormat="https://aka.ms/dotnet-warnings/{0}")>]
type SocketPermissionAttribute = class
inherit CodeAccessSecurityAttribute
[<System.AttributeUsage(System.AttributeTargets.Assembly | System.AttributeTargets.Class | System.AttributeTargets.Constructor | System.AttributeTargets.Method | System.AttributeTargets.Struct, AllowMultiple=true, Inherited=false)>]
[<System.Serializable>]
type SocketPermissionAttribute = class
inherit CodeAccessSecurityAttribute
Public NotInheritable Class SocketPermissionAttribute
Inherits CodeAccessSecurityAttribute
- Dědičnost
- Atributy
Poznámky
Chcete-li použít tento atribut, musí vaše Socket připojení odpovídat vlastnostem zadaným ve vaší SocketPermissionAttribute. Pokud chcete například použít oprávnění pro Socket připojení na portu 80, nastavte Port vlastnost SocketPermissionAttribute 80 na hodnotu 80. Informace o zabezpečení, které jsou zadané v SocketPermissionAttribute , jsou uloženy v metadatech cíle atributu, což je třída, na kterou SocketPermissionAttribute se použije. Systém pak přistupuje k informacím za běhu. Předání SecurityAction konstruktoru určuje povolené SocketPermissionAttribute cíle.
Poznámka
Vlastnosti SocketPermissionAttribute musí mít hodnoty, které nejsou null
. Po nastavení nelze hodnoty vlastností změnit.
Poznámka
Další informace o používání atributů naleznete v tématu Atributy.
Konstruktory
SocketPermissionAttribute(SecurityAction) |
Inicializuje novou instanci SocketPermissionAttribute třídy se zadanou SecurityAction hodnotou. |
Vlastnosti
Access |
Získá nebo nastaví metodu přístupu k síti, která je povolena tímto SocketPermissionAttribute. |
Action |
Získá nebo nastaví akci zabezpečení. (Zděděno od SecurityAttribute) |
Host |
Získá nebo nastaví název hostitele DNS nebo IP adresu, která je určena tímto SocketPermissionAttribute. |
Port |
Získá nebo nastaví číslo portu, který je přidružen k tomuto SocketPermissionAttribute. |
Transport |
Získá nebo nastaví TransportType , který je určen tímto SocketPermissionAttribute. |
TypeId |
Při implementaci v odvozené třídě získá jedinečný identifikátor pro tento Attribute. (Zděděno od Attribute) |
Unrestricted |
Získá nebo nastaví hodnotu označující, zda je deklarováno úplné (neomezené) oprávnění k prostředku chráněnému atributem. (Zděděno od SecurityAttribute) |
Metody
CreatePermission() |
Vytvoří a vrátí novou instanci SocketPermission třídy. |
Equals(Object) |
Vrací hodnotu, která určuje, zda je tato instance rovna zadanému objektu. (Zděděno od Attribute) |
GetHashCode() |
Vrátí hodnotu hash pro tuto instanci. (Zděděno od Attribute) |
GetType() |
Type Získá aktuální instanci. (Zděděno od Object) |
IsDefaultAttribute() |
Při přepsání v odvozené třídě určuje, zda hodnota této instance je výchozí hodnotou odvozené třídy. (Zděděno od Attribute) |
Match(Object) |
Při přepsání v odvozené třídě vrátí hodnotu, která označuje, zda se tato instance rovná zadanému objektu. (Zděděno od Attribute) |
MemberwiseClone() |
Vytvoří použádnou kopii aktuálního souboru Object. (Zděděno od Object) |
ToString() |
Vrátí řetězec, který představuje aktuální objekt. (Zděděno od Object) |
Explicitní implementace rozhraní
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) |
Mapuje sadu názvů na odpovídající sadu identifikátorů pro rozesílání. (Zděděno od Attribute) |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) |
Načte informace o typu objektu, který lze použít k získání informací o typu rozhraní. (Zděděno od Attribute) |
_Attribute.GetTypeInfoCount(UInt32) |
Získá počet rozhraní typu informací, které objekt poskytuje (0 nebo 1). (Zděděno od Attribute) |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) |
Poskytuje přístup k vlastnostem a metodám vystaveným objektem. (Zděděno od Attribute) |