你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
FaceSessionClient.GetLivenessWithVerifySessions 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
GetLivenessWithVerifySessions(String, Nullable<Int32>, RequestContext) |
[Protocol Method] Lists sessions for /detectLivenessWithVerify/SingleModal.
|
GetLivenessWithVerifySessions(String, Nullable<Int32>, CancellationToken) |
Lists sessions for /detectLivenessWithVerify/SingleModal. |
GetLivenessWithVerifySessions(String, Nullable<Int32>, RequestContext)
- Source:
- FaceSessionClient.cs
[Protocol Method] Lists sessions for /detectLivenessWithVerify/SingleModal.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler GetLivenessWithVerifySessions(String, Nullable<Int32>, CancellationToken) convenience overload with strongly typed models first.
public virtual Azure.Response GetLivenessWithVerifySessions (string start, int? top, Azure.RequestContext context);
abstract member GetLivenessWithVerifySessions : string * Nullable<int> * Azure.RequestContext -> Azure.Response
override this.GetLivenessWithVerifySessions : string * Nullable<int> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetLivenessWithVerifySessions (start As String, top As Nullable(Of Integer), context As RequestContext) As Response
Parameters
- start
- String
List resources greater than the "start". It contains no more than 64 characters. Default is empty.
- context
- RequestContext
The request context, which can override default behaviors of the client pipeline on a per-call basis.
Returns
The response returned from the service.
Exceptions
Service returned a non-success status code.
Examples
This sample shows how to call GetLivenessWithVerifySessions and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);
Response response = client.GetLivenessWithVerifySessions(null, null, null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].GetProperty("id").ToString());
Console.WriteLine(result[0].GetProperty("createdDateTime").ToString());
Console.WriteLine(result[0].GetProperty("sessionExpired").ToString());
This sample shows how to call GetLivenessWithVerifySessions with all parameters and parse the result.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);
Response response = client.GetLivenessWithVerifySessions("<start>", 1234, null);
JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result[0].GetProperty("id").ToString());
Console.WriteLine(result[0].GetProperty("createdDateTime").ToString());
Console.WriteLine(result[0].GetProperty("sessionStartDateTime").ToString());
Console.WriteLine(result[0].GetProperty("sessionExpired").ToString());
Console.WriteLine(result[0].GetProperty("deviceCorrelationId").ToString());
Console.WriteLine(result[0].GetProperty("authTokenTimeToLiveInSeconds").ToString());
Applies to
GetLivenessWithVerifySessions(String, Nullable<Int32>, CancellationToken)
- Source:
- FaceSessionClient.cs
Lists sessions for /detectLivenessWithVerify/SingleModal.
public virtual Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>> GetLivenessWithVerifySessions (string start = default, int? top = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetLivenessWithVerifySessions : string * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>>
override this.GetLivenessWithVerifySessions : string * Nullable<int> * System.Threading.CancellationToken -> Azure.Response<System.Collections.Generic.IReadOnlyList<Azure.AI.Vision.Face.LivenessSessionItem>>
Public Overridable Function GetLivenessWithVerifySessions (Optional start As String = Nothing, Optional top As Nullable(Of Integer) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of IReadOnlyList(Of LivenessSessionItem))
Parameters
- start
- String
List resources greater than the "start". It contains no more than 64 characters. Default is empty.
- cancellationToken
- CancellationToken
The cancellation token to use.
Returns
Examples
This sample shows how to call GetLivenessWithVerifySessions.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);
Response<IReadOnlyList<LivenessSessionItem>> response = client.GetLivenessWithVerifySessions();
This sample shows how to call GetLivenessWithVerifySessions with all parameters.
Uri endpoint = new Uri("<https://my-service.azure.com>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
FaceSessionClient client = new FaceSessionClient(endpoint, credential);
Response<IReadOnlyList<LivenessSessionItem>> response = client.GetLivenessWithVerifySessions(start: "<start>", top: 1234);
Remarks
List sessions from the last sessionId greater than the "start".
The result should be ordered by sessionId in ascending order.