判断是否有新消息,用静态类实现
static public class Newinfo
{
public Newinfo()
{
newold = 0;
} static private string fser;
static private string kefuid;
static private int newold; static public string Fser
{
get { return fser; }
set { fser = value; }
} static public string Kefuid
{
get { return kefuid; }
set { kefuid = value; }
}
static public int Newold
{
get { return newold; }
set { newold = value; }
}
}用户1,用户2. 用户1发出信息后,给静态变量赋值. 用户2端监听变量newold是0还是1. 如果有新消息,执行相应的动作.
我这样设计可以吗? 有没有更好的办法?
static public class Newinfo
{
public Newinfo()
{
newold = 0;
} static private string fser;
static private string kefuid;
static private int newold; static public string Fser
{
get { return fser; }
set { fser = value; }
} static public string Kefuid
{
get { return kefuid; }
set { kefuid = value; }
}
static public int Newold
{
get { return newold; }
set { newold = value; }
}
}用户1,用户2. 用户1发出信息后,给静态变量赋值. 用户2端监听变量newold是0还是1. 如果有新消息,执行相应的动作.
我这样设计可以吗? 有没有更好的办法?
解决方案 »
- 多表 分页 查询问题
- 时间是如何计算的?论坛中如何筛选出最近一周或者一个月发布的帖子?谢谢
- 请教关于使用微软企业库连接SQL2000,有时GetConnection取不到连接的问题
- asp.net2.0页面中Form用input和TextBox用哪个好?
- 路径转换?
- 弄了个控件,以后再要在页面里插入FLASH就方便了
- 我来揭发一下
- RedirectToRoute、RedirectToAction如何指定target ?
- 奉100分以谢高手
- 急求.net的在线编辑控件或源程序,就向richtextbox那样。斑竹或思归进来看一下:
- asp.net是不是也用正则表达式呀?请帮忙看一下下面这个函数什么意思?谢谢!
- 我的代码出错了,你能帮我看一下吗?
{ static private string fser;
static private string kefuid;
static private int newold=0;
先进先出
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
http://feiyun0112.cnblogs.com/