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

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网页版斗地主(未完待续)

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

Asp.Net解决Session丢失


在asp.net里面,很多时候使用session来保存一些对象,比如说购物车等等,有很多时候,就算你设置了session超时的时间,session还是会无缘无故的丢失,这里有一种比较简单的方法可以设置session丢失的时间。
在web.config里面如下配置
    <sessionState 
     & ......

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号