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

ASP.net中Timer和WebService的使用

 示例一
在Global.asax.cs文件中: 
 protected void Application_Start(Object sender, EventArgs e)
      {
               System.Timers.Timer timer1 = new System.Timers.Timer();
                timer1.Interval = 50000; // 50000 毫秒 = 50秒
                timer1.Elapsed += new System.Timers.ElapsedEventHandler(timer1_Elapsed);
                timer1.AutoReset = true;
                timer1.Enabled = true;
                timer1.Start();
       }
void timer1_Elapsed(object source, System.Timers.ElapsedEventArgs e)
      {
               // 在这里加上读取数据库的代码就可以实现后台服务定时访问数据库的功能,该功能对于实现文件解
        //锁、论坛定时统计等很有用。
       }
 
 
                                                                       示例二
 
通过在网站的Global.asax的Application_Start方法中
加入定时器 定时调用WebService
该WebService的一个方法 负责在后台
向数据库的某个表加入数据
步骤:
1.通过VS 新建一个网站
2.加入Global


相关文档:

一个简单的ASP.NET +ACCESS 登录

首页:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 ......

asp.net几个是用函数


/// <summary>
  
/// 得到站点用户IP
  
/// </summary>
  
/// <returns></returns>
  
public
 
static
 
string
 getUserIP()   
{   
    
retu ......

ASP.NET 实现多版本語言

public class PageBase:System.Web.UI.Page
{
 public PageBase()
 {
  //
  // TODO: Add constructor logic here
  //
 }
    protected override void InitializeCulture()
    {
        // ......

ASP.NET常用代码

http://www.chinaz.com/Program/.NET/101U1142006.html
  1. 打开新的窗口并传送参数:
传送参数:
response.write("<script>window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')</script>")
接收参数:
string a = Request.QueryString("id");
string b = Request.QuerySt ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号