磁盘空间低管理程序

时间:2015-09-24 01:43:48
【文件属性】:
文件名称:磁盘空间低管理程序
文件大小:333KB
文件格式:RAR
更新时间:2015-09-24 01:43:48
Delphi 注册表 { Date: 17-01-2007 } unit Unit1; interface uses Windows, Messages, SysUtils, Registry, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, WinSkinStore, WinSkinData, SkinCaption; type TForm1 = class(TForm) Button1: TButton; SkinData1: TSkinData; SkinStore1: TSkinStore; SkinCaption1: TSkinCaption; Label1: TLabel; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var myreg:TRegistry; begin myreg:=TRegistry.Create; with myreg do begin rootkey:=HKEY_CURRENT_USER; if openkey('Software\Microsoft\Windows\CurrentVersion\Policies\Explorer',false) and valueExists('NoLowDiskSpaceChecks') then //如果打开键成功且NoDrives存在,则进行下面操作。 begin if readinteger('NoLowDiskSpaceChecks')=1 then begin Button1.Caption:='打开“磁盘空间低”提示功能'; end else begin Button1.tabstop:=False; Button1.Font.Color:=clRed; Button1.Caption:='关闭“磁盘空间低”提示功能'; end; myreg.CloseKey; myreg.Free; end; end; end; procedure TForm1.Button1Click(Sender: TObject); var myreg:TRegistry; begin if Button1.caption='打开“磁盘空间低”提示功能' then begin myreg:=TRegistry.Create; with myreg do begin RootKey:=HKEY_CURRENT_USER; if openkey('Software\Microsoft\Windows\CurrentVersion\Policies\Explorer',true) then begin try WriteBool('NoLowDiskSpaceChecks',false); Application.MessageBox('成功打开磁盘空间低提示','提示:',mb_ok); //showmessage('成功打开磁盘空间低提示'); Button1.tabstop:=False; Button1.Font.Color:=clRed; Button1.Caption:='关闭“磁盘空间低”提示功能'; except Application.MessageBox('打开磁盘空间低提示出现错误,可能操作系统不支持此项功能','提示:',mb_ok); //showmessage('打开磁盘空间低提示出现错误,可能操作系统不支持此项功能'); end; end else begin Button1.Caption:='打开磁盘空间低提示出现错误,可能操作系统不支持此项功能'; Button1.Enabled; end; end; myreg.CloseKey; myreg.Free; end else begin myreg:=TRegistry.Create; with myreg do begin RootKey:=HKEY_CURRENT_USER; if openkey('Software\Microsoft\Windows\CurrentVersion\Policies\Explorer',true) then begin try WriteBool('NoLowDiskSpaceChecks',true); Application.MessageBox('成功关闭磁盘空间低提示','提示:',mb_ok); //showmessage('成功打开磁盘空间低提示'); Button1.tabstop:=False; Button1.Font.Color:=clWindowText; Button1.Caption:='打开“磁盘空间低”提示功能'; except Application.MessageBox('关闭磁盘空间低提示出现错误,可能操作系统不支持此项功能','提示:',mb_ok); //showmessage('打开磁盘空间低提示出现错误,可能操作系统不支持此项功能'); end; end else begin Button1.Caption:='关闭磁盘空间低提示出现错误,可能操作系统不支持此项功能'; Button1.Enabled; end; end; myreg.CloseKey; myreg.Free; end; end; end.
【文件预览】:
磁盘空间低管理程序
----Project1.dof(4KB)
----Unit1.dcu(6KB)
----Project1.exe(633KB)
----Unit1.dfm(106KB)
----Project1.cfg(422B)
----Project1.dpr(188B)
----Unit1.pas(4KB)
----Project1.res(876B)
----Unit1.ddp(51B)

网友评论