真爱无限的知识驿站

学习积累技术经验,提升自身能力

[转载]C#多线程BackgroundWorker使用示例

.Net WinForm Code:


using System;
using System.Collections.Generic;
using System.ComponentModel;////
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;
namespace BackgroundWorkerSample
{
    public partial class CalculateAddForm : Form
    {
        protected BackgroundWorker backgroundWorker1 = new BackgroundWorker();
        //private int numberToCompute = 0;
        //private int highestPercentageReached = 0;
        public CalculateAddForm()
        {
            InitializeComponent();
            InitializeBackgoundWorker();
           
        }
        // Set up the BackgroundWorker object by
        // attaching event handlers.
        private void InitializeBackgoundWorker()
        {
            this.backgroundWorker1.WorkerReportsProgress = true;
            this.backgroundWorker1.WorkerSupportsCancellation = true;
           
            this.backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork);
            this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
            this.backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
        }
        private long ComputeAdd(int n, BackgroundWorker worker, DoWorkEventArgs e)


jquery插件printArea打印、corner圆角

 

<div id="testdiv" class="demo" style="width:200px;height:150px;border-width:1px;border-style:solid;border-color:Blue;">
...

c#/.net用txt、in等作为数据存储的配置类


using System;

using System.Collections.Generic;

using System.Text;

using System.IO;

using System.Text.RegularExpressions;


namespace Tools

{

    #region 配置文件类 ConfigFile

Excel文件与DataSet之间的转化的探索与实现

.net操作Excel的支持库下载 NPOI2.0.1.zip

JAVA学习-Java常用类Date日期类、Math数学工具类、Random随机数类

Java常用类的使用

Date日期类

Date 表示特定的时间,精确到毫秒

构造方法:

public Date()

pulic Date(long date)//参数为时间戳值

.Net Json转换为DataTable小数自动转成整数造成错误的问题

1、原因

原生Json反序列化时,如果多行数据第一行为int,后面多行为decimal会字段转化为int

C#winform中只允许程序运行一个实例、显示已经运行的界面

private static System.Threading.Mutex mutex;
        /// <summary>
        /// 应用程序的主入口点。
        /// </summary>
...

.Net中Remoting通信的应用,有发送和返回信息

界面如图:  代码:服务端using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;u

用xml操作代码配置Web.config文件

    public class Webconfig    {        private string XmlFilePath;        private XmlDocument xmldoc

浅谈设计模式

学习设计模式也有很长时间了,说实话,老师以故事的方式讲课,我以前是听不进去的,因为老师所举的例子只是字面上表示那种模式,但实际想一下,不是那么回事,也就是说例子不是那么恰当。其实,对于几种觉的模式,把模式的定义看一下,再结合代码,就能理解了,不要20分钟就能讲完的内

<< 1 2 > >>

Powered By Z-BlogPHP 1.7.3

Copyright 2024-2027 pukuimin Rights Reserved.
粤ICP备17100155号