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

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

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

Path.GetPathRoot(file) 取得根目錄

Path.GetFullPath(file) 取得路徑

arrow
arrow
    創作者介紹
    創作者 痞客興 的頭像
    痞客興

    痞客興的部落格

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