private int num = 0;
[HttpPost]
public void sendIndex()
{
Thread t =new Thread(new ThreadStart(aaa));
t.Start();
}
public void aaa()
{
for (int a = 0; a < 10; a++)
{
System.Web.Caching.Cache objCache = HttpRuntime.Cache;
objCache.Insert("pc", a);
Thread.Sleep(1000);
}
}
[HttpPost]
public string getIndex()
{
System.Web.Caching.Cache objCache = HttpRuntime.Cache;
return objCache["pc"].ToString();
}
window.setInterval(function() {
$.post("/zh-cn/institutionalRevision/getIndex", null, function (r) {
alert(r);
});
}, 3000);
$.post("/zh-cn/institutionalRevision/sendIndex", null, function () {
});