WindowsIdentity.RunImpersonatedAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
RunImpersonatedAsync(SafeAccessTokenHandle, Func<Task>) |
Runs the specified asynchronous action as the impersonated Windows identity. |
RunImpersonatedAsync<T>(SafeAccessTokenHandle, Func<Task<T>>) |
Runs the specified asynchronous action as the impersonated Windows identity. |
RunImpersonatedAsync(SafeAccessTokenHandle, Func<Task>)
Runs the specified asynchronous action as the impersonated Windows identity.
public:
static System::Threading::Tasks::Task ^ RunImpersonatedAsync(Microsoft::Win32::SafeHandles::SafeAccessTokenHandle ^ safeAccessTokenHandle, Func<System::Threading::Tasks::Task ^> ^ func);
public static System.Threading.Tasks.Task RunImpersonatedAsync (Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, Func<System.Threading.Tasks.Task> func);
static member RunImpersonatedAsync : Microsoft.Win32.SafeHandles.SafeAccessTokenHandle * Func<System.Threading.Tasks.Task> -> System.Threading.Tasks.Task
Public Shared Function RunImpersonatedAsync (safeAccessTokenHandle As SafeAccessTokenHandle, func As Func(Of Task)) As Task
Parameters
- safeAccessTokenHandle
- SafeAccessTokenHandle
The handle of the impersonated Windows identity.
Returns
A task that represents the asynchronous operation of the provided Func<TResult>.
Applies to
RunImpersonatedAsync<T>(SafeAccessTokenHandle, Func<Task<T>>)
Runs the specified asynchronous action as the impersonated Windows identity.
public:
generic <typename T>
static System::Threading::Tasks::Task<T> ^ RunImpersonatedAsync(Microsoft::Win32::SafeHandles::SafeAccessTokenHandle ^ safeAccessTokenHandle, Func<System::Threading::Tasks::Task<T> ^> ^ func);
public static System.Threading.Tasks.Task<T> RunImpersonatedAsync<T> (Microsoft.Win32.SafeHandles.SafeAccessTokenHandle safeAccessTokenHandle, Func<System.Threading.Tasks.Task<T>> func);
static member RunImpersonatedAsync : Microsoft.Win32.SafeHandles.SafeAccessTokenHandle * Func<System.Threading.Tasks.Task<'T>> -> System.Threading.Tasks.Task<'T>
Public Shared Function RunImpersonatedAsync(Of T) (safeAccessTokenHandle As SafeAccessTokenHandle, func As Func(Of Task(Of T))) As Task(Of T)
Type Parameters
- T
The type of the object to return.
Parameters
- safeAccessTokenHandle
- SafeAccessTokenHandle
The handle of the impersonated Windows identity.
Returns
A task that represents the asynchronous operation of func
.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈