HttpRequest.IsAuthenticated プロパティとは何? わかりやすく解説 Weblio辞書 (original) (raw)
名前空間: System.Web
アセンブリ: System.Web (system.web.dll 内)
構文
Public ReadOnly Property IsAuthenticated As Boolean
Dim instance As HttpRequest Dim value As Boolean
value = instance.IsAuthenticated
public bool IsAuthenticated { get; }
public: property bool IsAuthenticated { bool get (); }
/** @property */ public boolean get_IsAuthenticated ()
public function get IsAuthenticated () : boolean
プロパティ値
要求が認証されている場合は **true**。それ以外の場合は **false**。
IsAuthenticated プロパティを使用して、現在の要求が認証されているかどうかを確認するコード例を次に示します。認証されていない場合、その要求は、ユーザーが自分の資格情報を Web アプリケーションに入力できる別のページにリダイレクトされます。これは、アプリケーションの既定のページで使用される一般的な手法です。
Private Sub Page_Load(sender As Object, e As EventArgs) ' Check whether the current request has been ' authenticated. If it has not, redirect the ' user to the Login.aspx page. If (Request.IsAuthenticated = False) Then Response.Redirect("Login.aspx") End If End Sub
private void Page_Load(object sender, EventArgs e) { // Check whether the current request has been // authenticated. If it has not, redirect the // user to the Login.aspx page. if (!Request.IsAuthenticated) { Response.Redirect("Login.aspx"); } }
Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。