ビジネスソースコード人気コードダウンロードwww.html.org.cn
バックグラウンドスレッドを起動すると、次の文を使用できます。CheckOnline Online = new checkonline();
ユーザーはそれをグローバルにすることができます。 Asaxでは、もうありません。簡単なテストのためにASPXファイルにしか入れません。次のように
//start.aspx
<%@ページ言語= c#autoeeventwireup = true debug = true%>
<%@アセンブリname = soholife%>
<%@namespace = systemm%>をインポートします
<%@namespace = soholife%>
<%@Import NameSpace = System.Collections%>
<スクリプトrunat = server言語= c#>
void page_load(オブジェクト送信者、eventargs args)
{{
CheckOnline Online = new checkonline();
}
</script>
<html> <head>
<style type = text/css>
td {font-size:12;}
.bgcolor {background:#ffffcc;}
</style>
</head>
<body> <center>
</center> </body> </html>
また、現在オンラインでサポートされているデータを表示するプログラムも必要です。
//online.aspx
<%@ページ言語= c#autoeeventwireup = true debug = true%>
<%@アセンブリname = soholife%>
<%@namespace = systemm%>をインポートします
<%@namespace = soholife%>
<%@Import NameSpace = System.Collections%>
<スクリプトrunat = server言語= c#>
void page_load(オブジェクト送信者、eventargs args)
{{
OnlineUser temp = new OnlineUser();
ArrayList Alluser = temp.Alluser;
文字列str =;
str += <trbgcolor =#ffff99>;
str += <td width = 100 align = center class = coolbar> user </td>;
str += <td align = center width = 150 class = coolbar>ログイン時間</td>
str += <td align = center width = 150 class = coolbar>最近の時間</td>;
str += <td width = 100 height = 20 class = coolbar>現在の位置</td>;
str += </tr>;
for(int i = 0; i <all .count; i ++)
{{
soholife.user tester =(soholife.user)alluser [i];
str += <trbgcolor = white>;
str + = <td> + tempuser.name + </td>;
str + = <td> + tempuser.lasttime + </td>;
str + = <td> + tempuser.curtime + </td>;
str + = <td> + tempuser.where + </td>;
str += </tr>;
}
maininfo.text = str;
}
</script>
<html> <head>
<style type = text/css>
td {font-size:12;}
.bgcolor {background:#ffffcc;}
</style>
<スクリプト言語= javascript>
機能OpenWindow(URL、W、H)
{{
window.open(url ,, toolbar = no、menubar = no、directories = no、status = yes、width = + w +、height = + h +、scrollbars = yes、resizable = yes);
falseを返します。
}
</script>
</head>
<body bgcolor =#ccffcc> <Enter>
<br>
<テーブル幅= 450 bgcolor = white cellpadding = 0 cellspacing = 0 style = border:none; >>
<tr> <td colorpan = 2 align = center class = bar>現在のオンラインユーザー</td> </tr>
</table> <br>
<asp:ラベルfont-size = 8pt id = showmsg runat = server/>
<テーブル幅= 450 bgcolor = white cellpadding = 2 cellspacing = 1 class = grid>
<asp:ラベルフォントサイズ= 8pt id = maininfo runat = server/>
</table>
</center> </body> </html>