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

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

MembershipUser.IsOnline プロパティ

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

ユーザーオンライン中であるかどうかを示す値を取得します

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

Dim instance As MembershipUser
Dim value As Boolean

value = instance.IsOnline
public bool IsOnline { get;
 }
public:
property bool IsOnline {
    bool get ();
}
/** @property */
public boolean get_IsOnline ()

プロパティ
ユーザーオンライン中である場合trueそれ以外場合false

解説解説

現在の日時から UserIsOnlineTimeWindow プロパティ値を引いた日時ユーザーの LastActivityDate より前になる場合ユーザーオンライン中と見なされます

ユーザーLastActivityDate は、CreateUser、UpdateUser、および ValidateUser の各メソッドにより現在の日時更新されます。また、GetUser メソッドオーバーロードにより更新できる場合あります

メモメモ

ユーザーLastActivityDate プロパティ値は、System.Web.Profile と System.Web.UI.WebControls.WebParts の名前空間内のクラスによって、ユーザー データデータ ソースから取得されたり、データ ソース設定されたりしたときに更新されます。アプリケーションが同じデータ ソース使用してユーザー情報格納し、ProfileProvider と PersonalizationProvider が MembershipProvider と同じ applicationName構成されている場合、そのユーザーLastActivityDate プロパティIsOnline プロパティは、この動作反映します。

使用例使用例

すべてのメンバシップ ユーザー名ListBox コントロール表示し選択したユーザー名対応する特定のメンバシップ情報 (メンバシップ ユーザーIsOnline プロパティ値など) をラベル表示するコード例次に示します

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

Dim users As MembershipUserCollection

Public Sub Page_Load()
  users = Membership.GetAllUsers()

  If Not IsPostBack Then
    ' Bind users to ListBox.
    UsersListBox.DataSource = users
    UsersListBox.DataBind()
  End If


  ' If a user is selected, show the properties for the selected user.

  If Not UsersListBox.SelectedItem Is
 Nothing Then
    Dim u As MembershipUser = users(UsersListBox.SelectedItem.Value)

    EmailLabel.Text = u.Email
    IsOnlineLabel.Text = u.IsOnline.ToString()
    LastLoginDateLabel.Text = u.LastLoginDate.ToString()
    CreationDateLabel.Text = u.CreationDate.ToString()
    LastActivityDateLabel.Text = u.LastActivityDate.ToString()
  End If
End Sub

</script>
<html>
<head>
<title>Sample: View User Information</title>
</head>
<body>

<form runat="server" id="PageForm">

  <h3>View User Information</h3>

  <table border="0" cellspacing="4">
    <tr>
      <td valign="top">
        <asp:ListBox id="UsersListBox" DataTextField="Username"
 
                     Rows="8" AutoPostBack="true"
 runat="server" />
      </td>
      <td valign="top">
        <table border=0 cellpadding=2 cellspacing=0>
          <tr>
           <td>E-mail:</td>
           <td><asp:Label runat="server"
 id="EmailLabel" /></td>
          </tr>
          <tr>
           <td>Is Online?:</td>
           <td><asp:Label runat="server"
 id="IsOnlineLabel" /></td>
          </tr>
          <tr>
           <td>LastLoginDate:</td>
           <td><asp:Label runat="server"
 id="LastLoginDateLabel" /></td>
          </tr>
          <tr>
           <td>CreationDate:</td>
           <td><asp:Label runat="server"
 id="CreationDateLabel" /></td>
          </tr>
          <tr>
           <td>LastActivityDate:</td>
           <td><asp:Label runat="server"
 id="LastActivityDateLabel" /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

</form>

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

MembershipUserCollection users;

public void Page_Load()
{
  users = Membership.GetAllUsers();

  if (!IsPostBack)
  {
    // Bind users to ListBox.
    UsersListBox.DataSource = users;
    UsersListBox.DataBind();
  }


  // If a user is selected, show the properties for the selected user.

  if (UsersListBox.SelectedItem != null)
  {
    MembershipUser u = users[UsersListBox.SelectedItem.Value];

    EmailLabel.Text = u.Email;
    IsOnlineLabel.Text = u.IsOnline.ToString();
    LastLoginDateLabel.Text = u.LastLoginDate.ToString();
    CreationDateLabel.Text = u.CreationDate.ToString();
    LastActivityDateLabel.Text = u.LastActivityDate.ToString();
  }
}

</script>
<html>
<head>
<title>Sample: View User Information</title>
</head>
<body>

<form runat="server" id="PageForm">

  <h3>View User Information</h3>

  <table border="0" cellspacing="4">
    <tr>
      <td valign="top">
        <asp:ListBox id="UsersListBox" DataTextField="Username"
 
                     Rows="8" AutoPostBack="true"
 runat="server" />
      </td>
      <td valign="top">
        <table border=0 cellpadding=2 cellspacing=0>
          <tr>
           <td>E-mail:</td>
           <td><asp:Label runat="server" id="EmailLabel"
 /></td>
          </tr>
          <tr>
           <td>Is Online?:</td>
           <td><asp:Label runat="server" id="IsOnlineLabel"
 /></td>
          </tr>
          <tr>
           <td>LastLoginDate:</td>
           <td><asp:Label runat="server" id="LastLoginDateLabel"
 /></td>
          </tr>
          <tr>
           <td>CreationDate:</td>
           <td><asp:Label runat="server" id="CreationDateLabel"
 /></td>
          </tr>
          <tr>
           <td>LastActivityDate:</td>
           <td><asp:Label runat="server" id="LastActivityDateLabel"
 /></td>
          </tr>
        </table>
      </td>
    </tr>
  </table>

</form>

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



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2024 GRAS Group, Inc.RSS