如何获取所选文件的详细信息,例如创建日期,大小 [英] How to get selected file details such as date created, size

查看:62
本文介绍了如何获取所选文件的详细信息,例如创建日期,大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在研究项目.我需要获取垂直文件夹的所有文件吗?
在列表框中,然后通过选择文件名,应提供文件详细信息
例如日期,大小,类型等.

Hi,

I m working on proj. whr I need to get all files of perticular folder
in a list box and by selecting the file name it shoul give the file details
such as Date,Size,type etc.

推荐答案

您可以使用 ^ ]类以获取文件属性.
You can use the FileInfo[^] class to get a files properties.


为所需文件创建
FileInfo

对象通过将该文件的完整路径作为参数传递给其构造函数.

使用该对象,您可以使用

object for the required file by passing complete path of that file as parameter to its constructor.

Using that object you can use

CreationTime, FullName, DirectoryName, LastAccesTime, Length, Type



希望这是您所需的详细信息.



Hope this is the required details for you.


这篇关于如何获取所选文件的详细信息,例如创建日期,大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆