zoukankan      html  css  js  c++  java
  • asp.net 多线程

    一般情况下,asp.net的代码是自上而下运行的,但有的情况需要多线程,比如发邮件这种操作,下面给出实现方案

    定义类

    public class ThreadWithEmailState
        {
            public string subject;
            public string content;
            public string receiver;
            public string ccs;
           
            public ThreadWithEmailState(string subject, string content, string receiver,string ccs)
            {
                this.subject = subject;
                this.content = content;
                this.receiver = receiver;
                this.ccs = ccs;
            }

            public void ThreadProc()
            {
                RISEmail.send(subject, receiver, content, ccs);
            }
        }

    调用

    ThreadWithEmailState tws = new ThreadWithEmailState(emailSubject, content[1], receiver, ccs);
    Thread t = new Thread(new ThreadStart(tws.ThreadProc));
    t.Start();

  • 相关阅读:
    Grove.net实践ORM学习笔记
    COM+的事务
    Delphi中MIDAS线程模型
    Delphi中封装ADO之我重学习记录。。。
    100 多个JaveScript 常用函数
    javascript 事件
    js 收藏
    js 常用函数
    表单11种Input的高级用法
    UltraEdit 使用技巧
  • 原文地址:https://www.cnblogs.com/kenny999/p/3110239.html
Copyright © 2011-2022 走看看