易截截图软件、单文件、免安装、纯绿色、仅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()
{


相关文档:

浅析asp.net生成随机密码

在开发需要用户注册后才能使用提供的各项功能的应用程序时,在新用户提交注册信息后,较常见的做法是由程序生成随机密码,然后发送密码到用户注册时填写的电子信箱,用户再用收到的密码来激活其帐户。
实现ASP.NET生成随机密码功能是很容易的,下面的代码给出了完整的实现方法:
publicstaticstringMakePassword(stringpw ......

使用ASP.Net Forms模式实现WebService身份验证

使用ASP.Net Forms模式实现WebService身份验证
    在安全性要求不是很高的ASP.Net程序中,基于Forms的身份验证是经常使用的一种方式,而如果需要对WebService进行身份验证,最常用的可能是基于Soap 标头的自定义身份验证方式。如果对两者做一下比较的话,显然,基于Forms的验证方式更加方便易用,能否将F ......

Asp.net 打印web 网页 如何不显示 网址 页码


1.对IE浏览器进行设置
 文件-〉页面设置-〉将里面的页眉和页脚的内容清空 就OK了
2.页面代码实现 Javascript
<!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><!--  & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号