SecurityContext.Run(SecurityContext, ContextCallback, Object) Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Kör den angivna metoden i den angivna säkerhetskontexten i den aktuella tråden.
public:
static void Run(System::Security::SecurityContext ^ securityContext, System::Threading::ContextCallback ^ callback, System::Object ^ state);
public static void Run(System.Security.SecurityContext securityContext, System.Threading.ContextCallback callback, object state);
[System.Security.SecurityCritical]
public static void Run(System.Security.SecurityContext securityContext, System.Threading.ContextCallback callback, object state);
static member Run : System.Security.SecurityContext * System.Threading.ContextCallback * obj -> unit
[<System.Security.SecurityCritical>]
static member Run : System.Security.SecurityContext * System.Threading.ContextCallback * obj -> unit
Public Shared Sub Run (securityContext As SecurityContext, callback As ContextCallback, state As Object)
Parametrar
- securityContext
- SecurityContext
Säkerhetskontexten som ska anges.
- callback
- ContextCallback
Ombudet som representerar metoden som ska köras i den angivna säkerhetskontexten.
- state
- Object
Objektet som ska skickas till återanropsmetoden.
- Attribut
Undantag
securityContext är null.
-eller-
securityContext inte förvärvades genom en avbildningsåtgärd.
-eller-
securityContext har redan använts som argument för ett Run(SecurityContext, ContextCallback, Object) metodanrop.
.NET 5+ (inklusive .NET Core): I samtliga fall.
Kommentarer
Säkerhetskontexten för den aktuella tråden returneras till dess tidigare tillstånd när metodanropet är klart.