InitDB(); FileCount ++ ; } }//for InvokeSetProgress( this.myProgress , myNames.Count , 0 ); InvokeSetLabelText( lblState , "正在删除临时文件..." ); System.IO.Directory.Delete( strOutSubDir , true ); InvokeSetLabelText( lblState , "操作完毕"); }//for string strDir2 = System.IO.Path.Combine( strOutDir ,"temp"); if( System.IO.Directory.Exists( strDir2 )) System.IO.Directory.Delete( strDir2 , true ); InsertNameCmd.Dispose(); InsertCmd.Dispose(); InvokeSetProgress( this.MainProgress ,1 , 0 ); }//try catch(Exception ext) { System.Windows.Forms.MessageBox.Show( ext.ToString()); } this.BeginInvoke( new System.EventHandler( this.EndProcess) , new object[]{null,null}); MainConn.Close(); MainConn.Dispose(); DataConn.Close(); DataConn.Dispose(); }//public void MsdnOut()
/// /// 获得指定目录及下层目录下所有的文件的绝对路径文件名 /// /// 根目录 /// 保存文件名的列表对象 public System.Collections.ArrayList GetFileNames( string strRootDir) { System.Collections.ArrayList myList = new System.Collections.ArrayList(); string[] strNames = System.IO.Directory.GetFiles( strRootDir , "*.*"); if( strNames != null && strNames.Length > 0 ) { myList.AddRange( strNames ); } strNames = System.IO.Directory.GetDirectories( strRootDir , "*.*"); if( strNames != null && strNames.Length > 0 ) { foreach( string strDir in strNames ) { |