|
![]() |
名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
Jscript.net可以用JScript 或任意NET 框架语言(如 C #,VB7.0) 通过增加extends主题词在类声明以后来继续和扩展现有类。这能力答应Jscript.net异常轻易地利用 NET 平台的丰厚资源。为了说明这些,给出一个程序。这个程序扩展了NET 框架的ServiceBase 类。 // 导入需要的.net命名空间 import System; import System.ServiceProcess; import System.Diagnostics; import System.Timers; class SimpleService extends ServiceBase { private var timer : Timer; function SimpleService() { CanPauseAndContinue = true; ServiceName = "JScript Service"; timer = new Timer(); timer.Interval = 1000; timer.AddOnTimer(OnTimer); } protected override function OnStart(args : String[]) { EventLog.WriteEntry("JScript Service started"); timer.Enabled = true; } protected override function OnStop() { EventLog.WriteEntry("JScript Service stopped"); timer.Enabled = false; } protected override function OnPause() { EventLog.WriteEntry("JScript Service paused"); timer.Enabled = false; } protected override function OnContinue() { EventLog.WriteEntry("JScript Service continued"); timer.Enabled = true; } function OnTimer(source : Object, e : EventArgs) { EventLog.WriteEntry("Hello World from JScript!"); } } ServiceBase.Run(new SimpleService()); 返回类别: 教程 上一教程: Microsoft IIS 真的如此「不安全」吗?(1) 下一教程: 利用ASP.NET设计FTP文件上传(下) 您可以阅读与"使用JScript.NET创建asp.net页面(五)"相关的教程: · 使用JScript.NET创建asp.net页面(一) · 使用JScript.NET创建asp.net页面(二) · 使用JScript.NET创建asp.net页面(六) · 使用JScript.NET创建asp.net页面(七) · 使用JScript.NET创建asp.net页面(四) |
![]() ![]() |
快精灵印艺坊 版权所有 |
首页![]() ![]() ![]() ![]() ![]() ![]() ![]() |