开发者

how to get ID from file

ho开发者_C百科w to get 3 from 3.hpdf

if it is a big int then how can i get it


There is a function for that:

  string name = System.IO.Path.GetFileNameWithoutExtension(fileName);
  int id = int.Parse(name);

That only works if your filenames look like 12345.hpdf


I think this will be helpful.

System.IO.Path.GetFileNameWithoutExtension(filename);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜