讀取指定資料夾下的所有檔案

2022-01-15 05:20:32 字數 505 閱讀 2779

c#怎樣讀取windows資料夾名和該資料夾中的excel表中的資料,並把讀到的資料夾名和excel表中的資料作為資料向插入到sql   sever2000的資料表中

private   void   button1_click_2(object   sender,   system.eventargs   e)  

private   void   addfile(string   directory)  

file.copy(fi, @"d:\" + filename.trim());//複製檔案

file.move(@"d:\" + filename.trim(), @"e:\" + filename.trim());//移動檔案  }  

foreach(string   di   in   directory.getdirectories(directory))  

}  

//用遞迴實現的。  

上面的是得到檔案,現在你要在此基礎上再處理一下  

遍歷讀取指定資料夾下指定型別的所有檔案

經常碰到朋友,尤其是初學者對指定資料夾下指定型別檔案的讀取很困惑,這裡,我把自己經常用的程式貼出來,供初學者學些 include stdafx.h include windows.h include include include iostream using namespace std typed...

php讀取指定目錄資料夾下所有檔名

方法1 dir dirname file cache hotwords 這裡輸入其它路徑 php遍歷資料夾下所有檔案 handle opendir dir.定義用於儲存檔名的陣列 array file array while false file readdir handle closedir ha...

python 複製指定資料夾下所有檔案

get all file by type 根據接收到的path 和type,獲得該path下所有以type型別結尾的檔案 get all file by string 根據接收到的path 和 list,獲得該path下所有的,包含list 裡字串的檔案 copy file by type 根據接收...