VB 2005 .aspx页面的定时器组件? [英] Timer Component for VB 2005 .aspx page?

查看:64
本文介绍了VB 2005 .aspx页面的定时器组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用

My.Computer.Network.Ping创建一个监控服务器状态的网站。我正在寻找一种方法来每隔一秒左右触发我的Ping()

功能。我看到一个Timer控件可用于Windows

表单,但它没有列在我的.ASPX页面中。是否有这样的控制?


谢谢。

I''m creating a website that monitors the status of servers using
My.Computer.Network.Ping. I''m looking for a way to fire off my Ping()
function every second or so. I see a Timer control availalble for Windows
forms but it is not listed for my .ASPX page. Is there such a control?

Thanks.

推荐答案

Ryan,

在Atlas中应该有这样的控制,标准你可以这样做。

http://www.vb-tips.com/default.aspx?...b-4d681b3d530a


我希望这会有所帮助,

Cor


" Ryan" <泰 - **** @ newsgroups.nospam> schreef in bericht

新闻:Ow ************** @ TK2MSFTNGP02.phx.gbl ...
Ryan,

There should be such a control in Atlas, standard you can make it like this.

http://www.vb-tips.com/default.aspx?...b-4d681b3d530a

I hope this helps,
Cor

"Ryan" <Ty****@newsgroups.nospam> schreef in bericht
news:Ow**************@TK2MSFTNGP02.phx.gbl...
我正在创作使用
My.Computer.Network.Ping监控服务器状态的网站。我正在寻找一种方法来每隔一秒左右触发我的Ping()
功能。我看到一个Timer控件可用于Windows
表单,但它没有列在我的.ASPX页面中。有这样的控制吗?

谢谢。
I''m creating a website that monitors the status of servers using
My.Computer.Network.Ping. I''m looking for a way to fire off my Ping()
function every second or so. I see a Timer control availalble for Windows
forms but it is not listed for my .ASPX page. Is there such a control?

Thanks.



你好瑞恩,

至于计时器组件,我假设您将在ASP.NET应用程序中执行一些

常量操作。这个操作是否特定于个人webform页面或者是一个应用程序范围

操作(就像背景工作者......)? Cor提供的文章

演示了如何创建javascript客户端计时器,这将在网页的client-sdie html中不断调用脚本函数。 />
文件。但是,如果您想要的是服务器端背景计时器,我认为您需要创建服务器端后台工作线程或

System.Timers。定时器实例做的工作.eg


==================

void Application_Start(对象发件人,EventArgs e)

{

计时器计时器=新的System.Timers.Timer();


HttpContext.Current。应用程序[" g_timer"] =计时器;


timer.Elapsed + = new ElapsedEventHandler(this.OnTimedEvent);

timer.Interval = 4000;

timer.Enabled = true;

}

==================== =======


问候,


Steven Cheng

Microsoft在线社区支持
============================================= =====


在回复帖子时,请回复群组通过您的新闻阅读器

,其他人可以从您的问题中学习并从中受益。


================ ==================================

此帖子提供按现状 ;没有保证,也没有赋予任何权利。


安全! www.microsoft.com/security

(此帖子按原样提供,不作任何保证,并且不授予

权利。)

Hello Ryan,

As for the timer component, I assume that you''re going to perform some
constant operations in your ASP.NET application. Is this operation
specific to individual webform page or is a application wide
operations(like a backgroun worker...)? The article Cor has provided
demonstrates how to create javascript client-side timer which will
constantly call a script function in the web page''s client-sdie html
document. However, if what you want is a server-side backgroun timer, I
think you would need to create a server-side background worker thread or a
System.Timers.Timer instance to do the work .e.g.

==================
void Application_Start(object sender, EventArgs e)
{
Timer timer = new System.Timers.Timer();

HttpContext.Current.Application["g_timer"] = timer;

timer.Elapsed += new ElapsedEventHandler(this.OnTimedEvent);
timer.Interval = 4000;
timer.Enabled = true;
}
===========================

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


谢谢史蒂文,这是有效的。但是,我的页面上有图像显示正在ping通的服务器的状态和这些图像没有被改变

苍蝇。我的Ping函数根据Ping成功或失败是否为
来更改ImageURL属性(成功为绿色图像,失败为红色)。我是否需要重新加载整个页面才能更新单个图像,或者是否需要另外一种方法来获取该图像以在页面上动态更新?
br />

谢谢。

" Steven Cheng [MSFT]" < ST ***** @ online.microsoft.com>在消息中写道

新闻:m8 ************** @ TK2MSFTNGXA01.phx.gbl ...
Thanks Steven, this works. However, I have images on my page showing the
status of the servers being pinged and these images are not being changed on
the fly. My Ping function changes the ImageURL property based on whether
the Ping succeeds or fails (green image for success, red for failure). Do I
have to re-load the entire page just to update a single image or is there
another way to get just that image to update dynamically on the page?

Thanks.
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message
news:m8**************@TK2MSFTNGXA01.phx.gbl...
Hello Ryan,

至于计时器组件,我假设你将在ASP.NET应用程序中执行一些
常量操作。此操作是否特定于单个webform页面或是应用程序范围的操作(如背景工作者......)? Cor提供的文章演示了如何创建javascript客户端计时器,它将在网页的client-sdie html
文档中不断调用脚本函数。但是,如果您想要的是服务器端的背景计时器,我认为您需要创建一个服务器端后台工作线程或一个
System.Timers.Timer实例来完成工作.eg

==================
void Application_Start(对象发送者,EventArgs e)
{
计时器计时器= new System.Timers.Timer();

HttpContext.Current.Application [" g_timer"] = timer;

timer.Elapsed + = new ElapsedEventHandler(this。 OnTimedEvent);
timer.Interval = 4000;
timer.Enabled = true;

}
============== =============



Steven Cheng
微软在线社区支持

= =================================================

在回复帖子时,请回复群组通过您的新闻阅读器,以便其他人可以从您的问题中学习并从中受益。

======================== ==========================

此帖子按原样提供。没有保证,也没有授予
权利。

获得安全! www.microsoft.com/security
(此帖已提供按原样,没有保证,也没有赋予
权利。)
Hello Ryan,

As for the timer component, I assume that you''re going to perform some
constant operations in your ASP.NET application. Is this operation
specific to individual webform page or is a application wide
operations(like a backgroun worker...)? The article Cor has provided
demonstrates how to create javascript client-side timer which will
constantly call a script function in the web page''s client-sdie html
document. However, if what you want is a server-side backgroun timer, I
think you would need to create a server-side background worker thread or a
System.Timers.Timer instance to do the work .e.g.

==================
void Application_Start(object sender, EventArgs e)
{
Timer timer = new System.Timers.Timer();

HttpContext.Current.Application["g_timer"] = timer;

timer.Elapsed += new ElapsedEventHandler(this.OnTimedEvent);
timer.Interval = 4000;
timer.Enabled = true;
}
===========================

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no
rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



这篇关于VB 2005 .aspx页面的定时器组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆