C# 從網頁下載檔案到指定路徑

C# 從網頁下載檔案到指定路徑

  1. using (WebClient webClient = new WebClient())
  2. {
  3. string FileOutput = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "abc.txt");
  4. webClient.DownloadFile("http://abc/abc.txt", FileOutput); //儲存路徑一定要加完整路徑
  5. }

 

留言

這個網誌中的熱門文章

ORA-12514: TNS: 監聽器目前不知道連線描述區中要求的服務

Oracle 工作排程 DBMS_JOB 筆記

Oracle 例外控制(Exception Control)