易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net自动执行任务

在复杂的业务应用程序中,有时候会要求一个或者多个任务在一定的时间或者一定的时间间隔内计划进行,比如定时备份或同步数据库,定时发送电子邮件,定期处理用户状态信息,支付系统中定期同步异常账单等等,我们称之为计划任务。实现计划任务的方法也有很多,可以采用SQLAgent执行存储过程,采用Windows任务调度程序来实现,也可以使用Windows服务来完成我们的计划任务,这些方法都是不错的解决方案。但是,以上这些都需要有服务器的权限才能进行,而对于虚拟主机客户使用的Web应用程序来说,这些方法实现起来并不是很简单的,主机服务提供商或者不能直接提供这样的服务,或者需要你支付许多额外的费用。 看过一些这方面的文章,发现有一个共同的缺点:IIS运行到一定时期,计划任务就停止了。查找原因发现是IIS的应用程序池定期回收导致计划任务停止。本文的这个方法可以解决应用程序池回收问题。
Global.asax.cs
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Timers;
using System.Net;
using System.IO;
using System.Text;
using System.Threading;
namespace qumiao.com
{
    public class Global : System.Web.HttpApplication
    {
        protected void Application_Start(object sender, EventArgs e)
        {
            //定义定时器 
            System.Timers.Timer myTimer = new System.Timers.Timer(5000);
            myTimer.Elapsed += new ElapsedEventHandler(myTimer_Elapsed);
            myTimer.Enabled = true;
        


相关文档:

asp.net时间格式大全

DateTime dt = DateTime.Now;
// Label1.Text = dt.ToString();//2005-11-5 13:21:25
// Label2.Text = dt.ToFileTime().ToString();//127756416859912816
// Label3.Text = dt.ToFileTimeUtc().ToString();//127756704859912816
// Label4.Text = dt.ToLocalTime().ToString();//2005-11-5 21:21:25
// Label5.Text = ......

js C# ASP.Net 正则去掉超链接(只是 和 )

//替换所有
Regex reg = new Regex(@"(?is)</?a\b[^>]*>(?:(?!</?a).)*</a>");
string result = reg.Replace(yourStr, "");
//保留www.abc.com链接
Regex reg = new Regex(@"(?is)</?a\b.*?href=(['""]?)(?!(?:http://)?www\.abc\.com)[^'""\s>]+\1[^>]*>(?<text>(?:(?!</?a).) ......

asp.net GridView的一些应用

应用1:GridView和CheckBox结合
效果图:
应用2:Extending the GridView Control
Code download available at: CuttingEdge05.exe (132 KB)
Browse the Code Online
 Contents
The GridView Difference
A New GridView Control
Adding a Checkbox Column
The New Grid In Action
Styling Selected ......

ASP.NET配置文件Web.config

认识ASP.NET配置文件Web.config
 一、认识Web.config文件
Web.config文件是一个XML文本文件,它用来储存 ASP.NET Web 应用程序的配置信息(如最常用的设置ASP.NET Web 应用程序的身份验证方式),它可以出现在应用程序的每一个目录中。当你通过VB.NET新建一个Web应用程序后,默认情况下会在根目录自动创建一个默认的
W ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号