站内信源码
Ⅰ ASP 站内信
可以教你做,但不提供源码
这里是网络知道
Ⅱ 如何实现站内信自动提示功能
通常是让页面自动刷新,如果网站访问量很大,要把自动刷新的时间间隔设大点,比如5分钟,这样最迟5分钟内就能看到。
<meta http-equiv=refresh content="300">
Ⅲ 谁有论坛上站内信实现jsp structs2源码啊
import java.io.*;
import java.util.List;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.ServletActionContext;
import com.credit.proj.entity.FileForm;
import com.credit.proj.entity.Message;
import com.credit.proj.entity.VMessage;
import com.credit.publicmodel.commons.BaseAction;
import com.credit.publicmodel.commons.Constants;
import com.credit.publicmodel.message.service.MessageService;
import com.credit.publicmodel.permission.security.userDetails.UserInfo;
import com.credit.publicmodel.util.DateUtil;
import com.credit.publicmodel.util.FileUtil;
import com.credit.publicmodel.util.JsonUtil;
/**
* @funciton 消息处理
*
* @author credit004
*
*/
public class MessageAction extends BaseAction implements Constants{
private static final long serialVersionUID = 1L;
private final Log log = LogFactory.getLog(getClass());
private int start;
private int limit;
private MessageService messageService;
// private int msgType;
private String sendToId;
private String piKey;
private String title;
private String content;
private int id;
private int isRead;
// private int processType = 0;
private int msgType;
private String title_S = "";
private int msgType_S = 0;
private String title_SS = "";
private int msgType_SS = 0;
/*文件上传*/
private File fileUpload;//上传文件 如若要设置原型的话,请注意
private String fileName;//上传的名字 如若要设置原型的话,请注意
private String contentType;//上传的类型 如若要设置原型的话,请注意
private int global_msgId;//附件下载(列表)
private int downId;//下载附件
private int del_msgId;//删除文件,设置message表 标识
FileForm ff = null;
/**所有新消息*/
public void getAllNewMessage() throws Exception{
UserInfo ui = (UserInfo)this.getSession().getAttribute("userDetails");
String userId = "%,"+String.valueOf(ui.getId())+",%";
int totalNumber = messageService.getReadMessageAmount(userId, 0);
List<VMessage> list = messageService.getUserReadMessageForPages(userId, start, limit,0);
JsonUtil.jsonFromList(list,totalNumber);
}
/**轮询*/
public int countMessage(){
UserInfo userInfo = (UserInfo)this.getSession().getAttribute("userDetails");
String userId = "%,"+String.valueOf(userInfo.getId())+",%";
int count = messageService.getReadMessageAmount(userId,0);
return count;
}
/**发送消息 jiang*/
public String sendMessage() throws Exception{
Message msg = new Message();
FileForm ff = new FileForm();
UserInfo userInfo = (UserInfo)this.getSession().getAttribute("userDetails");
//上传文件存储的名字
String storeFileName = "";
//上传路径
String path = "";
// judge
boolean isUploadOk = false;
String sendToId = ","+this.sendToId+",";
/*消息*/
msg.setPiKey(piKey);
msg.setType(msgType);
msg.setTitle(title);
msg.setContent(content);
msg.setCreateTime(DateUtil.getNowDateTime());
msg.setSendTime(DateUtil.getNowDateTime("yyyy-MM-dd (E) HH:mm"));
msg.setSendFrom(userInfo.getId());
msg.setProcessType(Constants.PROCESS_TYPE_BG);
msg.setTakePeople(sendToId);
/*文件上传 上传了文件*/
if(fileUpload != null){
storeFileName = "msg"+DateUtil.getNowDateTime("yyyyMMddHHmmssSSS")+FileUtil.getExtention(fileName);
path = "/upload/"+userInfo.getUsername()+"/msg/appendix/"+storeFileName;
String realPath = ServletActionContext.getServletContext()
.getRealPath(path);
File storeFile = new File(realPath);
System.out.println("文件长度="+fileUpload.length());
ff.setContentType(contentType);
ff.setIsDel(0);
ff.setSize(fileUpload.length());
ff.setName(fileName);
ff.setPath(path);
ff.setSendToId(sendToId);
ff.setTitle(userInfo.getName()+" 提供的附件");
ff.setType(1);//1 代表消息上传附件 待议
ff.setUploaderId(userInfo.getId());
ff.setUpTime(DateUtil.getNowDateTime());
isUploadOk = FileUtil.fileUpload(fileUpload, storeFile, this.BUFFER_SIZE_MSG);
msg.setHasAppendix(1);//设置有附件
if(!isUploadOk){
ff = null;
}
}else{
ff = null;//没上传文件
}
messageService.sendMessage(msg,ff);
return null;
}
/**删除消息 jiang*/
public void delMessage() throws Exception{
messageService.delMessage(id);
id = 0;//使用完后---初始化
}
/**得到详细信息 jiang*/
public void getDetailMessage() throws Exception{
messageService.getDetailMessage(id);
messageService.readMessage(id, 1);//设置已读
id = 0;//使用完后--初始化
}
/**设置已读 作废 jiang*/
public void readMessage() throws Exception{
log.info("isRead=="+isRead);
}
/**已读通知 已作废 jiang*/
public void getReadMesage() throws Exception{
UserInfo ui = (UserInfo)this.getSession().getAttribute("userDetails");
String userId = "%,"+String.valueOf(ui.getId())+",%";
int totalNumber = messageService.getReadMessageAmount(userId,1);
List<VMessage> list = messageService.getUserReadMessageForPages(userId, start, limit,1);
JsonUtil.jsonFromList(list,totalNumber);
}
/**收消息盒子*/
public void getMessageBox() throws Exception{
UserInfo ui = (UserInfo)this.getSession().getAttribute("userDetails");
String userId = "%,"+String.valueOf(ui.getId())+",%";
int isDel = 0;
List<VMessage> list = null;
int totalNumber = 0;
// System.out.println("show me the state"+isRead+processType+msgType);
if(title_S.equals("") && msgType_S == 0){
totalNumber = messageService.getAllMessageAmout(userId, isDel);
list = messageService.getUserMessageForPages(userId, isDel, start, limit);
}else{
String title_S = "%"+this.title_S+"%";
Object[] params = {userId,title_S,this.title_S,msgType_S,msgType_S,};
totalNumber = messageService.getSearchMessageAmount(params);
list = messageService.getUserSearchMessageForPages(params, start, limit);
}
JsonUtil.jsonFromList(list,totalNumber);
}
/**发消息盒子 jiang*/
public void sendMessageBox() throws Exception{
UserInfo ui = (UserInfo)this.getSession().getAttribute("userDetails");
String title_SS = "%"+this.title_SS+"%";
Object[] params = {ui.getId(),title_SS,this.title_SS,msgType_SS,msgType_SS};
//here codes
int totalNumber = messageService.getUserSendMessageAmount(params);
List<VMessage> list = messageService.getUserSendMessageForPages(params, start, limit);
JsonUtil.jsonFromList(list,totalNumber);
}
/*********************************************************************/
/** ################# 附件下载 ##################### **/
/*********************************************************************/
/**附件下载列表*/
public void showDownload() throws Exception{
int isDel = 0;
System.out.println("global_msgId="+global_msgId);
int totalNumber = messageService.getDownloadAmount(global_msgId, isDel);
List<FileForm> list = messageService.getDownload(global_msgId, isDel, start, limit);
JsonUtil.jsonFromList(list,totalNumber);
}
/*********************************************************************/
/**下载--获得输入流*/
public InputStream getMsgDownload(){
// FileForm ff = messageService.getFile(downId);
String path = ff.getPath();
System.out.println("ff=="+ff.getPath());
return ServletActionContext.getServletContext().getResourceAsStream(path);
}
/**下载--默认*/
public String msgDownload(){
ff = messageService.getFile(downId);
return "success";
}
/**下载--向struts.xml内传值 jiang*/
public String getDownloadFileName(){
// FileForm ff = messageService.getFile(downId);
String fileName = ff.getName();
try {
fileName = new String(fileName.getBytes(),"ISO8859-1");
if(ff != null){
return fileName;
}else{
return "";
}
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return "error";
}
/*********************************************************************/
/**删除 下载文件---只是在数据库标识已删除 jiang*/
public void delMsgDownload() {
String jsonStr = "";
try {
messageService.delFile(downId,del_msgId);
jsonStr = "{success:true}";
JsonUtil.writeJsonString(jsonStr);
} catch (Exception e) {
jsonStr = "{success:false}";
e.printStackTrace();
}finally{
JsonUtil.writeJsonStringNoException(jsonStr);
}
}
/*****回收站*******/
public void delectedMessage() throws Exception{
UserInfo ui = (UserInfo)this.getSession().getAttribute("userDetails");
String userId = "%,"+String.valueOf(ui.getId())+",%";
int totalNumber = messageService.getAllMessageAmout(userId, 1);
List<VMessage> list = messageService.getUserMessageForPages(userId, 1, start, limit);
JsonUtil.jsonFromList(list,totalNumber);
}
/**从数据库中删除消息*/
public void removeMessage(){
String jstonStr = "{success:false}";
try {
messageService.removeMessage(id);
jstonStr = "{success:true}";
} catch (Exception e) {
jstonStr = "{success:false}";
e.printStackTrace();
}
JsonUtil.writeJsonStringNoException(jstonStr);
}
/*############################ getter and setters ##########################*/
Ⅳ 高分求一个php实现站内信收发的源码!
你看 校内圈.com 是不是你想要的功能?
Ⅳ 求C#写的站内信源码,供参考!
tailinse了啊
Ⅵ 高分求一个PHP实现站内信收发的源码!~~
http://code.knowsky.com/down/15485.html 这个软件适合你的。
Ⅶ PHP源码网站问题
是想要用户点击领取之后,系统自动发送号码和密码给站内信呗?
流程大概是这样:
1.用户点击领取,进入优惠券处理代码。
2.得到操作的用户ID,连接优惠券的数据库表,从中选一对号码和密码,然后调用站内信代码,将号码和密码作为内容发送给操作的用户ID,判断发送是否成功,如果成功则删除这一对号码和密码,或者将这个表的是否已领取字段为true.
Ⅷ 如何实现网站,站内信自动提示功能
这个简单 你可以用服务器推技术 也可以用ajax 都能实现你的效果 而且是无刷新的 网络下 很多的..
Ⅸ C# 站内信是用什么机制完成的
站内信其实很简单.
您这么思考.
我要给当前系统的某个人发一条信息.那么这个人需要一张表.
表里面有:谁给我发的:发件人ID
发的什么内容:内容信息
什么标题:标题信息
什么时候发的:发送时间
给谁:收件人ID.
建立一个这样的表后,您只需要给他里面添加一条记录即可.
双方均可查询
查询我给谁发过: 查询该表 条件为发件人ID=我的ID
查询谁给我发过:查询该表 条件为 收件人ID=我的ID
Ⅹ asp.net+SQL2000 制作站内信
联系方式