120 likes | 301 Views
ASP.Net. 聊天室與新聞討論群組 M9153308 李佳聰. 聊天網頁的組成與操作. Enter.aspx. Talk.aspx. Chatroom.mdb (Chatroom). Chatroom.mdb (Users). Setup.aspx. View.aspx. Session. Chatroom.mdb(Users). Chatroom.mdb(Chatroom). R efresh. < html> <head>
E N D
ASP.Net 聊天室與新聞討論群組 M9153308 李佳聰
聊天網頁的組成與操作 Enter.aspx Talk.aspx Chatroom.mdb (Chatroom) Chatroom.mdb (Users) Setup.aspx View.aspx Session
Refresh • <html> • <head> • <META HTTP-EQUIV=“refresh” CONTENT=“1”;URL=“Reload.aspx”> • </head> • <body> • …………. • </body> • </html>
View.aspx • <head> • <META HTTP-EQUIV=“refresh” CONTENT=“<% =Freq %>” ;URL=“<% =URL %>”> • </head> • …… • Sub Page_Load(sender as Object, e As EventArgs) • Freq=session(“Freq”) • If Freq=o then Freq=30 • URL=Request.ServerVariables(“PATH_INFO”) • …… • End Sub
Setup.aspx • Sub Set_Click(sender as object, e as EventArgs) • If val(Freq.Text)>0 then • Session(“Freq”)=val(Freq.Text) • Else • Freq.Text=“30” • Session(“Freq”)=30 • End if • Msg.Text=“重讀時間間隔重設為”& Freq.Text & “秒” • End Sub
新聞討論群組 進入討論 Title.aspx 顯示標題 Detail.aspx 討論內容 返回討論主畫面 R/W R/W Newa.mdb
Relation Details Titles
SQL Statement • Limit to last 50 records • Select Top 50 From Titles Order By LastNewsDate Desc • Limit to last 2 weeks • Select * From Titles Where LastNewsDate > DateAdd(‘d’,-14,Now()) Order By LastNewsDate Desc • Upate Database • “Update Titles Set LastNewsDate=Now(), [Number]=[Number]+1” & “Where TitleID=“ & TitleID