原文:C# 獲取文件名、目錄、后綴、無后綴文件名、擴展名

string filePath C: .txt string str 獲取文件的全路徑: Path.GetFullPath filePath gt C: .txt str 獲取文件所在的目錄: Path.GetDirectoryName filePath gt C: Console.WriteLine str str 獲取文件的名稱含有后綴: Path.GetFileName filePath ...

2019-05-25 13:53 0 6338 推薦指數:

查看詳情

C# 獲取文件名無后綴文件名擴展名

C# 獲取文件名無后綴文件名擴展名string filePath = "E:\\test.txt";string LUJING = "獲取全路徑:" + Path.GetFullPath(filePath); //E:\\test.txtLUJING = "文件所在目錄 ...

Fri Mar 13 22:25:00 CST 2020 0 1546
C# 獲取文件名擴展名

string fullPath = @"d:\test\default.avi"; string filename = Path.GetFileName(fullPath);//返回帶擴展名文件名 "default.avi"string extension ...

Tue Oct 22 23:48:00 CST 2019 0 4684
C# 獲取文件名擴展名

strRecordFile="d:\RecordFile\2017\03\09\00020170309113442.wav"; 完整文件名: string strFilePaht=strRecordFile.Substring(strRecordFile.LastIndexOf ...

Thu Mar 09 20:14:00 CST 2017 0 1946
C# 獲取文件名擴展名

C# 獲取文件名擴展名 string aFirstName = aFile.Substring(aFile.LastIndexOf("\\") + 1, (aFile.LastIndexOf(".") - aFile.LastIndexOf("\\") - 1)); //文件名string ...

Tue Mar 27 22:08:00 CST 2018 0 8583
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM