站內信源碼
Ⅰ 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 製作站內信
聯系方式