asp.net 实现定时执行 一个方法
asp.net 实现定时执行 一个方法
public class Time_Task
{
public event System.Timers.ElapsedEventHandler ExecuteTask;
private static readonly Time_Task _task = null;
private System.Timers.Timer _timer = null;
private int _interval = 1000;
public int Interval
{
set
{
_interval = value;
}
get
{
return _interval;
}
}
static Time_Task()
{
_task = new Time_Task();
}
public static Time_Task Instance()
{
return _task;
}
public void Start()
{
if(_timer == null)
{
_timer = new System.Timers.Timer(_interval);
_timer.Elapsed += new System.Timers.ElapsedEventHandler(_timer_Elapsed);
_timer.Enabled = true;
_timer.Start();
}
}
protected void _timer_Elapsed(object sender, System.Timers
相关文档:
<asp:FileUpload /> 文件上传控件
实现一个简单的图片文件上传
//上传文件控件使用:实现上传图片功能,上传图片只能是jpg,gif,bmp三种类型,图片大小不超过60kb
后台代码:
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using ......
Session模型简介
Session是什么呢?简单来说就是服务器给客户端的一个编号。当一台WWW服务器运行时,可能有若干个用户浏览正在运正在这台服务器上的网站。当每个用户首次与这台WWW服务器建立连接时,他就与这个服务器建立了一个Session,同时服务器会自动为其分配一个SessionID,用以标识这个用户的唯一身份。这个SessionI ......
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.Attribute ......
Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法。你可以使用这个文件实现应用程序安全性以及其它一些任务。下面让我们详细看一下如何在应用程序开发工作中使用这个文件。
概述
Global.asax 位于应用 ......
ASP.NET URL Rewrite. URL重写
转自:http://www.cnblogs.com/rickel/archive/2007/02/04/639616.html
URL 重写是截取传入 Web 请求并自动将请求重定向到其他 URL 的过程。
比如浏览器发来请求hostname/101.aspx ,服务器自动将这个请求中定向为http://hostname/list.aspx?id=101。
url重写的优点在 ......