日期:2014-05-20  浏览次数:20890 次

如何实现隔30秒执行一次自定义方法 web
我自己定义了一个方法   showcat(i,temp);
  int   i       temp为字符串数组.

如何实现隔段时间就执行一次这个方法???




------解决方案--------------------
1.
setintenal()
2.
function funname()
{
settimeout(...);
funname();
}
------解决方案--------------------
thread.sleep(3000)
------解决方案--------------------
在你的页面中 放一个 <iframe frameborder= "0 " height= "0 " width= "0 " marginheight= "0 " marginwidth= "0 " scrolling= "no "
src= "upaction.aspx "> </iframe>
然后在upaction.aspx中 定时30秒刷新
<html>
<head>
<meta http-equiv= "refresh " content= "30;URL=upaction.aspx " />
</head>
</html>
每刷新一次 在upation.aspx的PageLoad中 执行你的方法showcat(i,temp);
------解决方案--------------------
2楼 4楼方法君可
------解决方案--------------------
如果是WEB的话就 <meta http-equiv= "refresh " content= "30;URL=upaction.aspx " /> ,WINFORM就TIMER
------解决方案--------------------
以上方法自己选吧
------解决方案--------------------
还是用线程吧