Código -fonte de negócios download popular download www.html.org.cn
Iniciando o encadeamento de segundo plano pode usar a seguinte frase:Checkonline online = new checkonline ();
Os usuários podem colocá -lo no Global. Na Asax, não tenho mais e só o coloco em um arquivo ASPX para um teste simples. do seguinte modo
//start.aspx
< %@página de página = c# autoeeventwireUp = true debug = true %>
< %@ Nome da montagem = Soholife %>
<%@Import Namespace = Systemm%>
<%@Import Namespace = Soholife%>
<%@Import Namespace = System.Collections%>
<script runat = servidor idioma = c#>
Void Page_load (remetente do objeto, EventArgs args)
{{
Checkonline online = new checkonline ();
}
</script>
<html> <head>
<Tipo de estilo = texto/css>
td {font-size: 12;}
.bgcolor {background: #ffffcc;}
</style>
</head>
<Body> <Center>
</central> </body> </html>
E também precisamos de um programa para exibir os dados que estão atualmente suportados online.
//online.aspx
< %@página de página = c# autoeeventwireUp = true debug = true %>
< %@ Nome da montagem = Soholife %>
<%@Import Namespace = Systemm%>
<%@Import Namespace = Soholife%>
<%@Importar namespace = System.Collections%>
<script runat = servidor idioma = c#>
Void Page_load (remetente do objeto, EventArgs args)
{{
onlinesuser temp = new onlineUser ();
Arraylist AllUser = temp.alluser;
string str =;
str += <trbgcolor =#ffff99>;
str += <td width = 100 align = Center Class = coolbar> Usuário </td>;
str += <td alinhe = largura central = 150 class = coolbar> tempo de login </td>
str += <td align = largura central = 150 class = coolbar> horário recente </td>;
str += <td width = 100 altura = 20 class = coolbar> posição atual </td>;
str += </tr>;
para (int i = 0; i <all .Count; i ++)
{{
Soholife.User tester = (Soholife.user) AllUser [i];
str += <trbgcolor = branco>;
str + = <td> + tempuser.name + </td>;
str + = <td> + tempuser.lasttime + </td>;
str + = <td> + tempuser.curtime + </td>;
str + = <td> + tempuser.iswhere + </td>;
str += </tr>;
}
maininfo.text = str;
}
</script>
<html> <head>
<Tipo de estilo = texto/css>
td {font-size: 12;}
.bgcolor {background: #ffffcc;}
</style>
<idioma de script = javascript>
Function OpenWindow (url, w, h)
{{
Window.open (url ,, barra de ferramentas = não, menubar = não, diretórios = não, status = sim, largura = + w +, altura = + h +, scrollbars = sim, redimensível = sim);
Retornar falso;
}
</script>
</head>
<corpo bgcolor =#ccffcc> <enter>
<br>
<Largura da tabela = 450 bgcolor = White CellPadding = 0 CellSpacacing = 0 Style = Border: Nenhum; >>
<tr> <td colorpan = 2 align = Center Class = Bar> Usuário online atual </td> </tr>
</tabela> <br>
<asp: etiqueta font-size = 8pt id = showmsg runat = server/>
<Largura da tabela = 450 bgcolor = White CellPadding = 2 Cellspacacing = 1 class = grade>
<asp: etiqueta font-size = 8pt id = maininfo runat = server/>
</tabela>
</central> </body> </html>