User Tools

Site Tools

blog:2024-08-24_001



2024-08-24 C#: 判斷檔案是否存在

Example

  • // 判斷 temp.txt 檔案是否存在
    string FileName = "temp.txt"; 
    if (System.IO.File.Exists(FileName)) 
    { 
       MessageBox.Show(FileName + " 檔案存在"); 
    } 
    else 
    { 
       MessageBox.Show(FileName + " 檔案不存在"); 
    }

TAGS

  • 32 person(s) visited this page until now.

Permalink blog/2024-08-24_001.txt · Last modified: 2024/08/24 21:27 by jethro

oeffentlich