This article is a mirror article of machine translation, please click here to jump to the original article.

View: 29874|Reply: 1

[Source] .NET/C# to get disk usage

[Copy link]
Posted on 2020-12-8 18:24:49 | | | |
Requirements: Get disk usage, you can intuitively see the hard disk usage in the background interface, no need to log in to the server to view, write your own code,Not online copy-paste

The renderings are as follows:



{
        "success": false,
        "code": 200,
        "message": "itsvse.com",
        "data": [{
                "name": "C:\\",
                "totalSize": 161236381696,
                "totalSizeString": "150.16 GB",
                "totalUsedSpace": 86086381568,
                "totalUsedSpaceString": "80.17 GB",
                "totalFreeSpace": 75150000128,
                "totalFreeSpaceString": "69.99 GB",
                "percentage": "53%"
        }, {
                "name": "D:\\",
                "totalSize": 785173704704,
                "totalSizeString": "731.25 GB",
                "totalUsedSpace": 209646657536,
                "totalUsedSpaceString": "195.25 GB",
                "totalFreeSpace": 575527047168,
                "totalFreeSpaceString": "536 GB",
                "percentage": "27%"
        }, {
                "name": "H:\\",
                "totalSize": 104853504,
                "totalSizeString": "100 MB",
                "totalUsedSpace": 34779136,
                "totalUsedSpaceString": "33.17 MB",
                "totalFreeSpace": 70074368,
                "totalFreeSpaceString": "66.83 MB",
                "percentage": "33%"
        }, {
                "name": "V:\\",
                "totalSize": 53686038528,
                "totalSizeString": "50 GB",
                "totalUsedSpace": 7382994944,
                "totalUsedSpaceString": "6.88 GB",
                "totalFreeSpace": 46303043584,
                "totalFreeSpaceString": "43.12 GB",
                "percentage": "14%"
        }]
}
The code is as follows:







Previous:Visual Studio 2019 (VS) Startup Bulletin fails to run during installation
Next:Manually validate model fields ASP.NET MVC
 Landlord| Posted on 2020-12-8 20:54:44 |
The web page displays disk information details



Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com