易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net定时执行代码

string LogPath;
Thread thread;
void WriteLog()
{
while (true)
{
StreamWriter sw = new StreamWriter(LogPath, true, Encoding.UTF8);
sw.WriteLine(thread.Name + ":" + DateTime.Now.ToString());
sw.Close();
Thread.CurrentThread.Join(1000 * 60);//阻止1分钟
}
}
void Application_Start(object sender, EventArgs e)
{
LogPath = HttpContext.Current.Server.MapPath("log.txt");
//在应用程序启动时运行的代码
thread = new Thread(new ThreadStart(WriteLog));
thread.Name = "写登录日志线程";
thread.Start();
}


相关文档:

ASP.NET 中如何防范SQL注入式攻击

一、什么是SQL注入式攻击?
  所谓SQL注入式攻击,就是攻击者把SQL命令插入到Web表单的输入域或页面请求的查询字符串,欺骗服务器执行恶意的SQL命令。在某些表
单中,用户输入的内容直接用来构造(或者影响)动态SQL命令,或作为存储过程的输入参数,这类表单特别容易受到SQL注入式攻击。常见的SQL注入式攻
击过程类如: ......

ASP.NET中网页倒计时代码

打开一个网页,上面显示5秒钟以后跳转到其他网页,每过一秒,它就会改变(4秒钟以后跳转,3秒钟以后跳转。。。)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head&g ......

ASP.NET页面刷新的实现方法

第一:
C# code
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
第二:
C# code
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( " < script language=javascript>window.location.h ......

ASP.NET 和 IIS 配置自定义扩展名网页

看过微软的网站有时候,是.MSPX的扩展名?其实你也可以配置,很简单。Here We Go!
配置WEB.CONFIG:
<system.web>
    <compilation>
       <buildProviders>
          <add  ......

asp.net防止重复提交数据

protected void Page_Load(object sender, EventArgs e)
...{
this.btnOK.Attributes.Add("onclick", ClientScript.GetPostBackEventReference(btnOK, "Click") + ";this.disabled=true; this.value='提交中...';");
}
//按钮处理方法
protected void btnOK_C ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号