正在阅读:.net中即时消息发送的实现…….net中即时消息发送的实现……

2004-02-14 09:34 出处:PConline 作者:icefox/ASPCool.com 责任编辑:zwg
.net中即时消息发送的实现…… 用了我一下午的时间终于写完并整理好了利用.net来发送即时消息的材料(当然了,还有上午的数据库设计:) 数据库设计:info表:id fromstu_id tostu_id content term 其中id是主键,fromstu_id是发送信息的用户的学号(这是和我做的学友录连在一起的),tostu_id是接受信息的用户的学号,content是消息的内容,term是判断是否为新消息。 下面的代码家在校友录中的if not ispostback中 '/////////////////////判断是否有新留言,将自动弹出页面 这里还要将页面的刷新时间设置一下,以便可以循环的读取信息。 Dim mysql As String = "select * from info where tostu_id=@myid and term=1" Dim comm As SqlCommand = New SqlCommand(mysql, conn) comm.Parameters.Add(New SqlParameter("@myid", SqlDbType.Int, 4)) comm.Parameters("@myid").Value = Session("stu_id") Dim dr As SqlDataReader conn.Open() dr = comm.ExecuteReader If dr.Read Then Response.Write("< script language=JavaScript >window.open ('info.aspx','','height=330,width=560,status=no,location=no,toolbar=no, directories=no,menubar=no')< /script >") End If dr.Close() comm.Cancel()
键盘也能翻页,试试“← →”键

关注我们

最新资讯离线随时看 聊天吐槽赢奖品