C#中获取文件信息的代码

如下的内容内容是关于C#中获取文件信息的内容,应该对大伙有一些好处。

FileInfo fi = new FileInfo(@"C:file.txt");

if(fi.Exists)
{
Console.WriteLine("Filename : {0}", fi.Name);
Console.WriteLine("Path : {0}", fi.FullName);
}




猜你喜欢

转载自www.cnblogs.com/odsxe/p/10754954.html