RolePrincipal.IsRoleListCached プロパティとは何? わかりやすく解説 Weblio辞書

RolePrincipal.IsRoleListCached プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > RolePrincipal.IsRoleListCached プロパティの意味・解説 

RolePrincipal.IsRoleListCached プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

ユーザーロールの一覧が Cookieキャッシュされているかどうかを示す値を取得します

名前空間: System.Web.Security
アセンブリ: System.Web (system.web.dll 内)
構文構文

Dim instance As RolePrincipal
Dim value As Boolean

value = instance.IsRoleListCached
public bool IsRoleListCached { get;
 }
public:
property bool IsRoleListCached {
    bool get ();
}
/** @property */
public boolean get_IsRoleListCached ()
public function get IsRoleListCached
 () : boolean

プロパティ
ロール名が Cookieキャッシュされている場合trueそれ以外場合false

解説解説
使用例使用例

ロール管理有効になっている場合に、現在のユーザーロールキャッシュ情報表示する例を次に示しますロール管理有効化詳細については、Roles クラストピック参照してください

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Web.Security"
 %>

<script runat="server">

Public Sub Page_Load()

    Try
    Dim r As RolePrincipal = CType(User, RolePrincipal)

    IsCachedLabel.Text     = r.IsRoleListCached.ToString()
    CacheChangedLabel.Text = r.CachedListChanged.ToString()
    ExpiredLabel.Text      = r.Expired.ToString()
    VersionLabel.Text      = r.Version.ToString()
    IssueDateLabel.Text    = r.IssueDate.ToString()
    ExpireDateLabel.Text   = r.ExpireDate.ToString()
    CookiePathLabel.Text   = r.CookiePath

    Msg.Text = ""
  Catch e As InvalidCastException
    Msg.Text = "User is not of type RolePrincipal. Are roles enabled?"
  End Try

End Sub

</script>
<html>
<head>
<title>Role Information</title>
</head>
<body>

<form runat="server">

  Role Information for <B><%=User.Identity.Name%></B>.<BR>

  <asp:Label id="Msg" runat="Server"
 ForeColor="maroon" /><BR>

  <table border=1 cellpadding=4 cellspacing=4>
    <tr>
      <td>IsRoleListCached</td>
      <td><asp:Label id="IsCachedLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>CachedListChanged</td>  
      <td><asp:Label id="CacheChangedLabel"
 runat="Server" /></td>
    </tr>
    <tr>
      <td>Expired</td>
      <td><asp:Label id="ExpiredLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>Version</td>
      <td><asp:Label id="VersionLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>IssueDate</td>
      <td><asp:Label id="IssueDateLabel"
 runat="Server" /></td>
    </tr>
    <tr>
      <td>ExpireDate</td>
      <td><asp:Label id="ExpireDateLabel"
 runat="Server" /></td>
    </tr>
    <tr>
      <td>CookiePath</td>
      <td><asp:Label id="CookiePathLabel"
 runat="Server" /></td>
    </tr>
  </table>

</form>


</body>
</html>
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Security" %>

<script runat="server">

public void Page_Load()
{

  try
  {
    RolePrincipal r = (RolePrincipal)User;

    IsCachedLabel.Text     = r.IsRoleListCached.ToString();
    CacheChangedLabel.Text = r.CachedListChanged.ToString();
    ExpiredLabel.Text      = r.Expired.ToString();
    VersionLabel.Text      = r.Version.ToString();
    IssueDateLabel.Text    = r.IssueDate.ToString();
    ExpireDateLabel.Text   = r.ExpireDate.ToString();
    CookiePathLabel.Text   = r.CookiePath;

    Msg.Text = "";
  }
  catch (InvalidCastException)
  {
    Msg.Text = "User is not of type RolePrincipal. Are roles enabled?";
  }

}

</script>
<html>
<head>
<title>Role Information</title>
</head>
<body>

<form runat="server">

  Role Information for <B><%=User.Identity.Name%></B>.<BR>

  <asp:Label id="Msg" runat="Server" ForeColor="maroon"
 /><BR>

  <table border=1 cellpadding=4 cellspacing=4>
    <tr>
      <td>IsRoleListCached</td>
      <td><asp:Label id="IsCachedLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>CachedListChanged</td>  
      <td><asp:Label id="CacheChangedLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>Expired</td>
      <td><asp:Label id="ExpiredLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>Version</td>
      <td><asp:Label id="VersionLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>IssueDate</td>
      <td><asp:Label id="IssueDateLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>ExpireDate</td>
      <td><asp:Label id="ExpireDateLabel" runat="Server"
 /></td>
    </tr>
    <tr>
      <td>CookiePath</td>
      <td><asp:Label id="CookiePathLabel" runat="Server"
 /></td>
    </tr>
  </table>

</form>


</body>
</html>
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

RolePrincipal.IsRoleListCached プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



RolePrincipal.IsRoleListCached プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS