string file = @"d:\abc\123.txt"

Path.GetFileNameWithoutExtension(file) 取得檔案名,不包含副檔名,本例得到123

Path.GetExtension(file) 取得副檔名txt

Path.GetPathRoot(file) 取得根目錄

Path.GetFullPath(file) 取得路徑

arrow
arrow

    痞客興 發表在 痞客邦 留言(0) 人氣()