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

apss asp.net C# web 定时执行程序

using System;
using System.Collections;
using System.ComponentModel;
using System.Web;
using System.Web.SessionState;
using System.Timers;
using System.Data;
using System.Data.SqlClient;
namespace SMS_joke
{
/// <summary>
/// Global 的摘要说明。
/// </summary>
public class Global : System.Web.HttpApplication
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
InitializeComponent();
}
protected void Application_Start(Object sender, EventArgs e)
{
SetTimer();
}
protected void Session_Start(Object sender, EventArgs e)
{
}
protected void Application_BeginRequest(Object sender, EventArgs e)
{
}
protected void Application_EndRequest(Object sender, EventArgs e)
{
}
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
}
protected void Application_Error(Object sender, EventArgs e)
{
}
protected void Session_End(Object sender, EventArgs e)
{
}
protected void Application_End(Object sender, EventArgs e)
{
}
public static void SetTimer()
{
System.Timers.Timer aTimer = new System.Timers.Timer();
aTimer.Elapsed += new ElapsedEventHandler(OnTimer);
aTimer.Interval = 5000;
aTimer.Enabled = true;
}
public static void OnTimer(Object source, ElapsedEventArgs e)
{
System.Data.SqlClient.SqlConnection sqlConnection1;
System.Data.SqlClient.SqlCommand sqlCommand1;
string customSetting = System.Configuration.ConfigurationSettings.AppSettings["SqlStr"];
sqlConnection1 = new SqlConnection();
sqlConnection1.ConnectionString = customSetting ;
sqlConnection1.Open();
string str = "UPDATE TABLE1 SET js = js + 1 " ;
sqlCommand1 = new SqlCommand(str,sqlConnection1) ;
sqlCommand1.ExecuteNonQuery();
sqlConnection1.Close();
}
#region Web 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{


相关文档:

Apache run asp.net==>2.0以上的版本


以下内容,丛网上COPY过来的...
Apache是目前广泛使用的一种网络服务器程序,不仅在UNIX/LINUX平台上被大量使用,而且在Windows平台上也有许多站点放弃了IIS而转向Apache。.NET是微软推出的功能强大的开发技术,其目标就是与Java抗衡。ASP.NET非常适合于中小企业的Web应用,其性能较ASP3.0有了极大的提高。下面就介绍让Ap ......

启用ASP.NET数据绑定控件里字段的显示格式

ASP.NET数据绑定控件(GridView、DataList、DetailsView、FormView等)里的字段设定格式后,却不起作用,显示还是原来的格式,没有按设定显示出来。
这里是要设置字段的一个属性才能要让字段格式起作用, 必须让数据字段的HtmlEncode属性为False,否则字段数据不会按格式显示。 ......

ASP.Net五种缓存机制

Application
1.Application用来保存所有用户共用的信息
2.在Asp时代,如果要保存的数据在应用程序生存期内不会或者很少发生改变,那么使用Application是理想的选择。但是在Asp.net开发环境中我们把类似的配置数据放在Web.config中。
3.如果要使用Application 要注意的是所有的写操作都要在Application_OnStart事件中完成 ......

ASP.NET网站建设之代码分离

在我们传统的网站建设中通常是先设计网站页面,再利用开发工具,在网站的框架内进行功能设计。这样的网站建设存在很多弊端,其中最突出的缺点是不利于小组共同开发,各环节之间依赖性太强。
在ASP.NET中我们可以利用后台编码,把HTML用户界面设计(颜色、美学等)与页面代码区分开来。这样就可以解决我们小组的并行开发问 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号