다음을 통해 공유


ISessionIDManager.Validate(String) 메서드

정의

제공된 세션 식별자가 유효한지 확인합니다.

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

유효성을 검사할 식별자입니다.

반환

Boolean

세션 식별자가 유효하면 true이고, 그렇지 않으면 false입니다.

예제

다음 코드 예제에서는 구현 된 Validate 메서드를 유효한 세션 id 값을 확인 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 구현을 호출 해야 합니다 Validate 메서드에서 GetSessionID 메서드를 제공된 된 세션 식별자의 형식이 올바르게 지정 되었는지 확인 하기 위해 HTTP 요청에서 세션 식별자를 검색할 때.

적용 대상

추가 정보