110,502
社区成员
发帖
与我相关
我的任务
分享
private void t2_Elapsed(object source, ElapsedEventArgs e)
{
if (this.running == false)
{
string readSql = "select * from [Folder]";
fswCmd = new OleDbCommand(readSql, fswCon);
readRead = fswCmd.ExecuteReader();
while (readRead.Read())
{
this.upList2.Add((string)readRead["change"]);
this.upList2.Add((string)readRead["dataName"]);
this.upList2.Add((string)readRead["fileName"]);
this.upList2.Add((string)readRead["fileType"]);
this.upList2.Add((string)readRead["fullPath"]);
}
t2.Enabled = false;
t2.Stop();
this.Invoke((MethodInvoker)delegate { this.Updatelist(); });
readCmd.Dispose();
if (upList2.Count != 0 && this.backgroundWorker2.IsBusy != true) { this.backgroundWorker2.RunWorkerAsync(); }
}
}
老大呀,我这段里面查询字段简直就是乱跳呀,查询字段里面一会出错一会没错一会加第一个一会加第四个
static void watcher_Changed(object sender, FileSystemEventArgs e)
{
string extend = e.FullPath.Substring(e.FullPath.LastIndexOf('.'));
switch (extend)
{
case ".xls":
break;
case ".doc":
break;
default:
break;
}
}