需要一份能发在线消息的源代码

zhizi 2003-10-20 10:38:56
希望能在用户登录以后,能呼叫在线用户,或给不在线的用户留言.
...全文
30 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
skyover 2003-10-20
  • 打赏
  • 举报
回复
Try
uName = Server.UrlDecode(Request.Cookies.Item("wuyinMember")("userName"))
Catch ex As Exception

End Try
Dim myreader As SqlClient.SqlDataReader = _mydb.ExecuteReader("select userid from [user] where userName=@p0", incept.Value.Trim)

If ((myreader.HasRows)) Then
myreader.Close()
_mydb.ExecuteNonQuery("insert into message (incept,sender,title,content,sendtime,flag,issend) values (@p0,@p1,@p2,@p3,GetDate(),0,1)", incept.Value.Trim, uName, title.Value.Trim, content.Value.Trim)
MsgPanel.Visible = False
Call WuyinWeb.CommonClass.DispInfo("<b>恭喜您,您的短消息已经成功发送到" & incept.Value & "信箱中!</b><br /><hr size=1 height=1 noshade width=100% />您可以:<br /><li><a class=px12 href=" & Request.ServerVariables("HTTP_REFERER") & ">返回上一页</a><li><a class=px12 href=../ >回到论坛首页</a><li><a class=px12 href=/ >返回首页</a>", msg)
Else
MsgPanel.Visible = False
Call WuyinWeb.CommonClass.DispInfo("<b>本论坛好像没有<font color=""red"">" & incept.Value & "</font>这个会员呀!~请检查一下吧!</b><br /><hr size=1 height=1 noshade width=100% />您可以:<br /><li><a class=px12 href=" & Request.ServerVariables("HTTP_REFERER") & ">返回上一页</a><li><a class=px12 href=../ >回到论坛首页</a><li><a class=px12 href=/ >返回首页</a>", msg)
End If
End Sub
rgbcn 2003-10-20
  • 打赏
  • 举报
回复
see

http://expert.csdn.net/Expert/topic/2260/2260089.xml?temp=.1410639
rgbcn 2003-10-20
  • 打赏
  • 举报
回复
下个动网论坛的代码看一下就知道了。
guoyan19811021 2003-10-20
  • 打赏
  • 举报
回复
短信那一条是一个框架,这个框架中的页面是1000秒自动刷新一次:
<meta http-equiv="Refresh" content="1000;URL=/expert/deeptree/contentbar.asp?myie=ie">
看看这个框架里面的源文件,每过一定时间刷新一次,用脚本控制图片的显示
-------------------
<html>
<head>
<meta http-equiv="Refresh" content="1000;URL=/expert/deeptree/contentbar.asp?myie=ie">
<META NAME="Robots" CONTENT="noindex">
<meta content="text/html;charset=gb2312" http-equiv="Content-Type">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="MSThemeCompatible" content="Yes">

<TITLE>Deeptree Content Bar</TITLE>
<LINK REL="stylesheet" TYPE="text/css" HREF="/csdn.css">
<script src="/Expert/style/get_css.js"></script>
</head>
<script language="javascript">
if (top.location == self.location)
{
top.location.href = "/Expert/Forum.asp";
}

function selectstart()
{
window.event.cancelBubble = true;
window.event.returnValue = false;
return false;
}
function GoToURL(strX)
{
if (strX == "" || strX == null || strX == "undefined")
{
return;
}
window.top.location.href = strX;
}
function mylogin(url)
{
window.parent.parent.location = url+"&from="+window.parent.parent.location.pathname+"&Roomid=&typenum=&tabletype=&searchKeys=&author=&whichpage=";
}
function mylogin2(url)
{
window.open(url+"&from="+window.parent.parent.location.pathname);
newMessage.style.visibility = "hidden";
}
function loginsub()
{
document.login.submit();
}
//-->
</SCRIPT>
<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" class="color3">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<tr>
<td align="left" VALIGN="top" width="100%" NOWRAP>

<div id="showtoc" name="showtoc" style="display:none;">

<table onclick="top.dtbar.showtoc();" align="left" border=0 cellpadding=0 cellspacing=0 title="显示菜单" style="cursor:hand">
<tr>
<td height="30"></td>
<td height="30" valign="middle"><img title="显示菜单" border="0" src="/expert/deeptree/images/showtoc.gif" /></td>
<td height="30"></td>
<td height="30" valign="middle"><a href="#"><font face="verdana" color="#FFFFFF">显示菜单</font></a></td>
</tr>
</table>
</div>
<table border="0" width="100%">
<form method="post" action="/member/logon.asp" target="_top" name="login">
<script>
document.write("<input type='hidden' name='from' value='")
document.write(parent.parent.location)
document.write("'>")
</script>
<tr><td valign="top">
<font color="#ffffff">

<img src="/images/1d.GIF" width="19" height="15">欢迎您:acewang
<img src="/images/1d.GIF" width="19" height="15">可用分:3510
<img src="/images/1d.GIF" width="19" height="15">总信誉分:100
<img src="/images/1d.GIF" width="19" height="15"><a href="/member/logonout.asp" target="_top"><font color="#ffffff">注销我的登录</font></a>
</td><td>

<div id="newMessage" name="newMessage" style="visibility:visible">
<a href="/Message_Board/NewMessage.asp?typestate=0" onClick="javascript:newMessage.style.visibility = 'hidden';" target="_blank" class="Func"><font color="#ffffff">你有短消息</font><img src="/Expert/images/mail.GIF" width="26" height="16" align="absmiddle" border="0"></a><br/>
</div>
<bgsound src="/Expert/Deeptree/newMessage.wav" border="0">

</font>
</td></tr></form></table></td></tr></table>
</body>
</html>


guoyan19811021 2003-10-20
  • 打赏
  • 举报
回复
定义数据库字段一个标志,用来标记是否已经读取
在客户端定时刷新,检索数据库,判断当前用户是否存在有未度过的消息。
如果有则提示。就像csdn一样
ajex 2003-10-20
  • 打赏
  • 举报
回复
定时刷新嘛.
TomLi98011 2003-10-20
  • 打赏
  • 举报
回复
写个web service
srj911 2003-10-20
  • 打赏
  • 举报
回复
xue xi
liuyd 2003-10-20
  • 打赏
  • 举报
回复
学习
stpangpang 2003-10-20
  • 打赏
  • 举报
回复
学习

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧