Finding out total and free disk space in .NET

前端 未结 9 1246
我在风中等你
我在风中等你 2021-01-04 03:08

I am trying to find a way to determine the total and available disk space in an arbitrary folder from a .NET app. By \"total disk space\" and \"available disk space\" in a f

9条回答
  •  日久生厌
    2021-01-04 03:29

    You can use GetDiskFreeSpaceEx from kernel32.dll which works with UNC-paths and drives. All you need to do is include a DllImport (see link for an example).

提交回复
热议问题