ISessionIDManager.Validate(String) 메서드
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
제공된 세션 식별자가 유효한지 확인합니다.
public:
bool Validate(System::String ^ id);
public bool Validate(string id);
abstract member Validate : string -> bool
Public Function Validate (id As String) As Boolean
매개 변수
- id
- String
유효성을 검사할 세션 식별자입니다.
반품
true세션 식별자가 유효한 경우 그렇지 않으면 . false
예제
다음 코드 예제에서는 메서드를 Validate 구현하고 세션 식별자 값이 유효한 Guid지 확인합니다.
public bool Validate(string id)
{
try
{
Guid testGuid = new Guid(id);
if (id == testGuid.ToString())
return true;
}
catch
{
}
return false;
}
Public Function Validate(id As String) As Boolean _
Implements ISessionIDManager.Validate
Try
Dim testGuid As Guid = New Guid(id)
If id = testGuid.ToString() Then _
Return True
Catch
End Try
Return False
End Function
설명
이 메서드는 Validate 제공된 id 세션 식별자가 유효한지 확인합니다.
ISessionIDManager 제공된 세션 식별자의 형식이 올바르게 지정되도록 HTTP 요청에서 세션 식별자를 검색할 때 구현에서 메서드를 호출 ValidateGetSessionID 해야 합니다.