[英]how to get ID from file
如何從3.hpdf
獲取3
如果它是一個大整數,那我怎么能得到它
有一個功能:
string name = System.IO.Path.GetFileNameWithoutExtension(fileName);
int id = int.Parse(name);
僅當文件名看起來像12345.hpdf時,此方法才有效
我認為這會有所幫助。
System.IO.Path.GetFileNameWithoutExtension(filename);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.