日期:2014-05-20 浏览次数:20793 次
class ProcessFile { //省略部分代码 public void FileProcessThread() { //.........省略部分代码 //访问文件夹,获取文件列表并进行文件处理 for (int i = 0; i < folderinfoTable.Rows.Count;i++ ) { Thread proProcess = new Thread(new ParameterizedThreadStart(mcdprofileProcess)); proProcess.Start(folderinfoTable.Rows[i]); } } void mcdprofileProcess(object objdr) { VersionManage versionmanage = new VersionManage(localdbconnstr); //........ bool ismatch=versionmanage.CheckVersionmatch(mcdlocalfilelistforversion[0].FullName, mcdVersion); } } 线程方法调用的类: class VersionManage { //数据库连接 DBOperation dboperation; public VersionManage(string connectionstring) { dboperation = new DBOperation(connectionstring); } public bool CheckVersionmatch(string filepath,string VersionName) { //获取该版本类型的数量的sql语句 string getVernumstr = "SELECT COUNT(*) FROM(SELECT dbo.FILE_VERSION.Version_Name FROM dbo.FILE_VERSION GROUP BY Version_Name) AS temp WHERE temp.Version_Name='" + VersionName + "'"; [color=#FF0000] object vernumobj = dboperation.ExecuateScalar(getVernumstr);[/color] //.......................(省略) } }