社区
数据库及相关技术
帖子详情
用程序怎么实现监测磁盘的容量,给出答案给满分
earthman113
2004-12-08 05:14:27
比如说,执行一下程序,能把系统盘C还有多少容量显示出来就行了
...全文
103
5
打赏
收藏
用程序怎么实现监测磁盘的容量,给出答案给满分
比如说,执行一下程序,能把系统盘C还有多少容量显示出来就行了
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
earthman113
2004-12-09
打赏
举报
回复
mangw讲得很对
earthman113
2004-12-09
打赏
举报
回复
GetDiskFreeSpaceEx(DiskName.c_str(),byte,free,cluster);报了很多错误
earthman113
2004-12-09
打赏
举报
回复
我想将查询的结果发到另外一台机子上,怎么做
h98458
2004-12-08
打赏
举报
回复
得到磁盘剩余空间:
long double __fastcall TForm1::GetFreeSpace1(String DiskName)
{ // 返回字节
PULARGE_INTEGER byte,cluster,free;
if(DiskName.Length()>3)
DiskName.SetLength(3);
byte=new ULARGE_INTEGER;
cluster=new ULARGE_INTEGER;
free=new ULARGE_INTEGER;
GetDiskFreeSpaceEx(DiskName.c_str(),byte,free,cluster);
long double aa=cluster->QuadPart;
return(aa);
}
mangw
2004-12-08
打赏
举报
回复
.h
//---------------------------------------------------------------------------
#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Chart.hpp>
#include <ExtCtrls.hpp>
#include <Series.hpp>
#include <TeEngine.hpp>
#include <TeeProcs.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TComboBox *ComboBox1;
TLabel *Label1;
TChart *Chart1;
TPieSeries *Series1;
void __fastcall FormCreate(TObject *Sender);
void __fastcall ComboBox1Change(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
.cpp
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
#include <mmsystem.h>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
char c;
String S;
int type;
for(c='A';c<='Z';c++)
{
S=String(c)+":";
type=GetDriveType(S.c_str());
if(type==DRIVE_FIXED)
ComboBox1->Items->Add(S);
}
if(ComboBox1->Items->Count==0)
ComboBox1->Items->Add("抱歉,没有找到硬盘。");
else
{
ComboBox1->ItemIndex=0;
DWORD sector,byte,cluster,free;
long totalspace,freespace;
GetDiskFreeSpace("C:\\",§or,&byte,&free,&cluster);
totalspace=long(cluster)*long(byte)/1024/1024*long(sector);
freespace=int(free)*int(byte)/1024/1024*int(sector);
Series1->Add(totalspace-freespace,"已用空间",clBlue);
Series1->Add(freespace,"可用空间",clPurple);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ComboBox1Change(TObject *Sender)
{
DWORD sector,byte,cluster,free;
long totalspace,freespace;
String path;
path=ComboBox1->Text+"\\";
GetDiskFreeSpace(path.c_str(),§or,&byte,&free,&cluster);
totalspace=long(cluster)*long(byte)/1024/1024*long(sector);
freespace=int(free)*int(byte)/1024/1024*int(sector);
Series1->Clear();
Series1->Add(totalspace-freespace,"已用空间",clBlue);
Series1->Add(freespace,"可用空间",clPurple);
}
//---------------------------------------------------------------------------
rac数据库存储在线迁移和
磁盘
冗余模式修
2-学会如何对rac数据库
磁盘
冗余模式进行修改 课程简介: 针对实际生产需求,贴近实战。让同学们收益最大化。 一课程主题 模拟生产环境,学会oracle19-13rac的存储迁移和
磁盘
冗余模式修改 二课程特色 针对...
2023年上半年 软件设计师
答案
解析
(5)信息服务:用户按查询条件发起农事信息请求,对相关地块农事...某文件管理系统采用位示图(bitmap)来记录
磁盘
的使用情况,若计算机系统的字长为64位,
磁盘
容量
为512GB,物理块的大小为4MB,那么位示图的大小为。
2023年上半年软件设计师上午试卷及
答案
21、某文件管理系统采用位示图(bitmap)来记录
磁盘
的使用情况,若计算机系统的字长为64位,
磁盘
容量
为512GB,物理块的大小为4MB,那么位示图的大小为。(26) A. P(S1)P(S2)和V(S3)V(S4) B. P(S1)P(S2)...
2023年上半年软件设计师试题及
答案
解析
加工规格说明需要
给出
实现
加工的细节 D. 决策树、决策表可以用来表示加工规格说明 以下关于好的软件设计原则的叙述中,不正确的是 (16) 。 (16) A. 模块化 B. 提高模块独立性 C. 集中化 D. 提高抽象...
2023年软件设计师上午试题及参考
答案
2023年上半年软件设计师上午试题级
答案
数据库及相关技术
1,178
社区成员
18,939
社区内容
发帖
与我相关
我的任务
数据库及相关技术
C++ Builder 数据库及相关技术
复制链接
扫一扫
分享
社区描述
C++ Builder 数据库及相关技术
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章