ซอร์สโค้ดธุรกิจยอดนิยมดาวน์โหลด www.html.org.cn
การเริ่มต้นเธรดพื้นหลังสามารถใช้ประโยคต่อไปนี้:checkOnline online = new CheckOnline ();
ผู้ใช้สามารถวางไว้บนทั่วโลก ใน Asax ฉันไม่มีอีกแล้วและฉันก็ใส่ไว้ในไฟล์ ASPX เพื่อทดสอบอย่างง่าย ดังนี้
//start.aspx
< %@page language = c# autoeeventwireup = true debug = true %>
< %@ ชื่อแอสเซมบลี = soholife %>
<%@import namespace = systemm%>
<%@import namespace = soholife%>
<%@import namespace = system.collections%>
<script runat = ภาษาเซิร์ฟเวอร์ = c#>
เป็นโมฆะ page_load (ผู้ส่งวัตถุ EventArgs args)
-
checkOnline online = new CheckOnline ();
-
</script>
<html> <head>
<style type = text/css>
TD {FONT-SIZE: 12;}
.BGCOLOR {พื้นหลัง: #FFFFCC;}
</style>
</head>
<body> <center>
</enter> </body> </html>
และเรายังต้องการโปรแกรมเพื่อแสดงข้อมูลที่สนับสนุนออนไลน์ในปัจจุบัน
//online.aspx
< %@page language = c# autoeeventwireup = true debug = true %>
< %@ ชื่อแอสเซมบลี = soholife %>
<%@import namespace = systemm%>
<%@import namespace = soholife%>
<%@import namespace = system.collections%>
<script runat = ภาษาเซิร์ฟเวอร์ = c#>
เป็นโมฆะ page_load (ผู้ส่งวัตถุ EventArgs args)
-
onlineUser temp = new OnlineUser ();
ArrayList Alluser = temp.alluser;
string str =;
str += <trbgcolor =#ffff99>;
str += <td width = 100 align = center class = coolbar> ผู้ใช้ </td>;
str += <td align = ความกว้างกลาง = 150 class = coolbar> เวลาเข้าสู่ระบบ </td>
str += <td align = ความกว้างกลาง = 150 class = coolbar> เวลาล่าสุด </td>;
str += <td width = 100 ความสูง = 20 class = coolbar> ตำแหน่งปัจจุบัน </td>;
str += </tr>;
สำหรับ (int i = 0; i <ทั้งหมด. count; i ++)
-
soholife.user tester = (soholife.user) Alluser [i];
str += <trbgcolor = สีขาว>;
str + = <td> + tempuser.name + </td>;
str + = <td> + tempuser.lasttime + </td>;
str + = <td> + tempuser.curtime + </td>;
str + = <td> + tempuser.ishere + </td>;
str += </tr>;
-
maininfo.text = str;
-
</script>
<html> <head>
<style type = text/css>
TD {FONT-SIZE: 12;}
.BGCOLOR {พื้นหลัง: #FFFFCC;}
</style>
<ภาษาสคริปต์ = JavaScript>
ฟังก์ชั่น OpenWindow (URL, W, H)
-
window.open (url ,, toolbar = no, menubar = ไม่, ไดเรกทอรี = ไม่, สถานะ = ใช่, width = + w +, ความสูง = + h +, scrollbars = ใช่, resizable = ใช่);
กลับเท็จ;
-
</script>
</head>
<body bgcolor =#ccffcc> <เข้า>
<br>
<ความกว้างของตาราง = 450 bgcolor = สีขาว cellpadding = 0 cellspacing = 0 style = border: none; >>
<tr> <td colorpan = 2 align = center class = bar> ผู้ใช้ออนไลน์ปัจจุบัน </td> </tr>
</table> <br>
<ASP: Label Font-Size = 8pt ID = showmsg runat = เซิร์ฟเวอร์/>
<ความกว้างของตาราง = 450 bgcolor = สีขาว cellpadding = 2 cellspacing = 1 class = grid>
<ASP: Label Font-Size = 8PT ID = MainInfo runat = Server/>
</table>
</enter> </body> </html>