c# 时钟 多线程
一品田园 2014-12-01 09:11:50 错误提示:
Application: 前置机软件.exe
Framework Version: v4.0.30128
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
问题描述:隔一个小时执行一个操作,操作主要完成对数据库里的数据进行打包,每次操作数据量在2万左右,执行时间5到10分钟。为了在执行打包操作时,界面不出现假死现象,故加入多线程操作。
//=============时间===================
try
{
if (isstart == "0")
{
isstart = "1";
Thread t = new Thread(StartFH);
t.IsBackground = true;
t.Start();
}
}
catch (Exception ex)
{
lvResult.Items.Insert(0, AddListViewItem("Error", "报文处理", ex.Message));
}
//=================
private void StartFH()
{
DcNewFh();
OracleHelper.InsertORIGINALDATABAK();
OracleHelper.DeleteORIGINALDATA();
isstart = "0";
}
//==================
分数不多了,60分大家分分吧。