显示服务器驱动器的磁盘空间(C) [英] Show Disk Space of Server drive ( C )

查看:46
本文介绍了显示服务器驱动器的磁盘空间(C)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用asp.net显示

服务器磁盘

1)总磁盘空间
2)已用磁盘空间

有2个服务器

1)数据库服务器
2)Web服务器

我必须使用饼图来显示两个驱动器空间

我该怎么办?

是的,我们有自己的服务器,我们在其中部署了站点

I want show by using asp.net

Server Disk

1) total disk space
2) used disk space

There are 2 server

1) Database Server
2) Web Server

Both Drives spaces i have to show by using by Pie Chart

How can i done it?

Yes we have our own server where we deployed our site

推荐答案

有关服务器磁盘空间的信息,请参见 DriveInfo.TotalSize [DriveInfo.AvailableFreeSpace [
For info on server disk space see DriveInfo Class[^].

There you have DriveInfo.TotalSize[^] and DriveInfo.AvailableFreeSpace[^].


您也可以使用WMI来获取磁盘空间.
请参阅
使用Windows Management Instrumentation(WMI)-第1部分 [ [ ^ ] .
You can also use WMI to get the disk space.
See Working With Windows Management Instrumentation (WMI) - Part 1[^] to help you get started.

MSDN has got some good information on WMI as well[^].


我认为您无法在数据库服务器上获得可用空间,除非它是您自己的服务器.

顺便说一句,如果您使用的是托管服务,那么就不必知道总的可用磁盘空间,因为它们将成为每个托管网站的配额.

您必须注意,您的站点可能未托管在C:驱动器上.

因此,总而言之,如果您拥有自己的服务器,除了出于管理目的之外,这没有多大意义.
I don''t think you will be able to get available space on database server except if it is your own servers.

By the way, if you are using an hosting service, it does not make sence to know the total available disk space as their will be quota for each hosted web site.

You have to be aware that your site might not be hosted on C: drive.

Thus in conclusion, this does not make much sense except for administrative purpose if you have your own servers.


这篇关于显示服务器驱动器的磁盘空间(C)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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