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

1.什么是cookie?
cookie 是一小段文本信息,伴随用户请求,在web服务器和浏览器之间传递。用户每次访问站点的时候,
web应用程序都可以读取cookie包含的信息。
假设在用户请求您的网站的某个页面时,您的应用程序不仅是返回请求的页面。同时也返回一个包含日期
和时间的cookie。用户的浏览器在获得页面的同时也获得了 ......

asp.net获取当前时间

在c# / ASP.net中我们可以通过使用DataTime这个类来获取当前的时间。通过调用类中的各种方法我们可以获取不同的时间:如:日期(2008-09-04)、时间(12:12:12)、日期+时间(2008-09-04 12:11:10)等。
//获取日期+时间
DateTime.Now.ToString();            // 2008- ......

近期作品 asp.net网页版斗地主(未完待续)

首先申明 纯属个人练习之作 请勿用于商业目的..........无语
纪念一下我以前的一个作品<窥>,以后就用它当我的LOGO了
今天是首发,这篇文章我会持续更新,我参照了园区里前辈的经验,摸索着去实现,目前大体的还未完善,先发张图上来...
......

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号