C 獲取乙個檔案的相關資訊

2021-09-06 07:28:34 字數 568 閱讀 9755

system.io.path.getextension( "path");

changeextension   更改路徑字串的副檔名。 

combine   合併兩個路徑字串。

getdirectoryname   返回指定路徑字串的目錄資訊。 

getextension   返回指定的路徑字串的副檔名。

getfilename   返回指定路徑字串的檔名和副檔名。 

getfilenamewithoutextension   返回不具有副檔名的指定路徑字串的檔名。 

getfullpath   返回指定路徑字串的絕對路徑。 

getpathroot   獲取指定路徑的根目錄資訊。 

gettempfilename   返回唯一臨時檔名並在磁碟上通過該名稱建立零位元組檔案。

gettemppath   返回當前系統的臨時資料夾的路徑。 

ha***tension   確定路徑是否包括副檔名。

ispathrooted   獲取乙個值,該值指示指定的路徑字串是包含絕對路徑資訊還是包含相對路徑資訊。

乙個用C 獲取硬體資訊的類

乙個用c 獲取硬體資訊的類 獲得主機ip位址 public string gethostip 獲取cpu編號 public string getcpuid return strcpuid catch return strharddiskid catch exception ex 獲取網絡卡mac位址...

C 獲取電腦的相關資訊

建立者 菜刀居士的部落格 建立日期 2014年08月31號 功能 獲取電腦的相關資訊 public class computerhelper return string.empty 獲取網絡卡mac位址 public static string getmacaddress return string...

C 獲取檔案資訊

1.獲取檔案簡單資訊 使用system.io.fileinfo類獲取 using system.io fileinfo fi new fileinfo yourfilename public directoryinfo directory public string directoryname pu...