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

ASP.NET(C#) 定时执行一段代码

 在Global.asax启动一条线程就ok了,下面是启动线程定时写文件的例子
  Global.asax
  C# code
  Code
  1<%@ Application Language="C#" %>
  2<%@ Import Namespace="System.IO" %>
  3<%@ Import Namespace="System.Threading" %>
  4<script runat="server">
  5    string LogPath;
  6    Thread thread;
  7    void WriteLog()
  8    {
  9        while (true)
  10        {
  11            StreamWriter sw = new StreamWriter(LogPath, true, Encoding.UTF8);
  12            sw.WriteLine(thread.Name + ":" + DateTime.Now.ToString());
  13            sw.Close();
  14            Thread.CurrentThread.Join(1000 * 60);//阻止1分钟
  15        }
  16    }
  17    void Application_Start(object sender, EventArgs e)
  18    {
  19        LogPath = HttpContext.Current.Server.MapPath("log.txt");
  20        //在应用程序启动时运行的代码
  21         thread = new Thread(new ThreadStart(WriteLog));
  22        thread.Name = "写登录日志线程";
  23        thread.Start();
  24    }
  25
  26    void Application_End(object sender, EventArgs e)
  27    {
  28        //在应用程序关闭时运行的代码
  29
  30    }
  31
  32    void Application_Error(object sender, EventArgs e)


相关文档:

asp.net 打印

<html>
<head>
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<title>***WSOFT.NET***</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--media=print 这个属性可以在打印时有效-->
<mce:st ......

asp.net中操作Excel全集

首先在 Web.Config 中添加模拟帐号 
<identity impersonate="true" userName="administrator"password="password" />
 
         其次 要添加 EXCEL com 组件。如果是EXCEL2003,则添加 EXcel library 11.0 版本。我把用到的引用头文件列举如下:
 
&nbs ......

演练:使用 XCOPY 部署 ASP.NET Web 应用程序

演练:使用 XCOPY 部署 ASP.NET Web 应用程序
部署 ASP.NET 应用程序非常简单。您需要将所创建的应用程序文件从开发计算机复制到将承载应用程序的成品 Web 服务器。可以使用 XCOPY 命令行工具或喜欢的 FTP 应用程序,将文件从一个位置复制到另一个位置。有关常规部署的更多信息,请参见 .NET Framework 部署基础。
注意 ......

ASP.NET(c#)语音验证码制作(附源代码)

最近发现语音验证码越来越流行,比如有次在注册gmail邮箱看到过,还有msn页面也有语音验证码,还有国外一些网站等。
花时间研究了下,语音验证码主要跟一般验证码的区别就在于如何让验证码播放。本文语音验证码原理:从服务器生成验证码,
并保存到cookie中(getcode.aspx.cs),当点收听验证码的时候,调用javascirpt操作 ......

ASP.NET创造Web服务治理Web服务状态

 ASP.NET创设Web服务治理Web服务状态
2009-四-21
XML Web服务在种兑现衍生于WebService种的XML Web服务时,可以运用和其余ASP.NET应用程序雷同的状态治理选项。WebService种包孕好多公共ASP.NET对象,包括Session和Application对象。
Application对象提供一个存储运作在Web应用程序中的代码可访问的数据的机制,而S ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号