易截截图软件、单文件、免安装、纯绿色、仅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 视图状态

 Web 是基于无状态的http协议,ASP.NET 为了保证控件在页面传送到服务器,再从服务器发回到页面的时保持之前的状态。
代码准备:
在aspx页面上添加一个listbox控件,和一个button服务器控件:
<
asp:ListBox runat
=
"
server
"
 ID
=
"
lbViewState
"
></
asp ......

解决datalist中单选按钮可以多选的问题(Asp.Net)

问题描述:
Asp.Net中datalist等web控件里面,放多个单选按钮的时候可以同时多选。
问题解决:
最理想的解决之道,用javascript:
<script language="javascript" type="text/javascript">
function clickit() {
        var dom=document.all;
    & ......

ASP.NET程序中常用的三十三种代码

1. 打开新的窗口并传送参数:
  传送参数:
response.write("<script>window.open(’*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"’)</script>")
  接收参数:
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
  2.为按钮添加对话框
Button1 ......

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

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