C# 中的文件路径/大小
如何获取文件的文件目录 (C:\myfolder\subfoler\mydoc.pdf)。 我还想添加子文件夹的大小,最后添加主文件夹的大小。 这是针对 .NET CLR 的,我需要将其与 SQL Server 2005 集成以获得 SSRS 报告。
How to get the File Directory of a file (C:\myfolder\subfoler\mydoc.pdf). I also want to add the size of the subfolders, and finally the main folder size. This is for a .NET CLR that I need to integrate with SQL Server 2005 for a SSRS report.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 GetDirectoryName,仅获取文件的目录路径:
要计算目录和子目录大小,可以执行以下操作:
You can use GetDirectoryName, to get only the directory path of the file:
For calculating the directory and subdirectory size, you can do something like this: