⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uattribute.pas

📁 类似于写字板,但此功能强大,可以扩展到许多地方
💻 PAS
字号:
unit UAttribute;

interface

uses
  Windows,  Messages, SysUtils, Classes,
  Graphics, Controls, Forms,    Dialogs,
  StdCtrls;

type
  TFormAttribute = class(TForm)
    ButtonClose: TButton;
    Memo: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormAttribute: TFormAttribute;

implementation

uses UNotePad;

{$R *.DFM}

procedure TFormAttribute.FormCreate(Sender: TObject);
var
  mem :MemoryStatus;
  attr:integer;
  attrstr:string;
  h   :integer;
  x,y,z,a:cardinal;
begin
  Left:=NotePadForm.Left+20;
  Top:=(Screen.Height-Height) div 2;
  with Memo.Lines do
  begin
    if FileName='' then
    begin
      Add('文件全名:'+'未命名');
      Add('文件属性:无');
      Add('创建时间:正在创建');
    end
    else
    begin
      Add('文件全名:');
      Add(FileName);
      attr:=FileGetAttr(FileName);
      attrstr:='文件属性:';
      if (attr and faReadOnly)>0 then
        attrstr:=attrstr+'只读 ';
      if (attr and faHidden)>0   then
        attrstr:=attrstr+'隐藏 ';
      if (attr and faSysFile)>0  then
        attrstr:=attrstr+'系统 ';
      if (attr and faArchive)>0  then
        attrstr:=attrstr+'存档 ';
      Add(attrstr);
      h:=FileOpen(FileName,fmOpenRead);
      Add('创建时间:'+DateTimeToStr(FileDateToDateTime(FileGetDate(h))));
      FileClose(h);
    end;
    Add('文件长度:'+IntToStr((NotePadForm.RichEdit.GetTextLen) div 1024)+'KB');
    Add('全部行数:'+IntToStr(NotePadForm.RichEdit.Lines.Count)+'行');
    GlobalMemoryStatus(mem);
    Add('系统内存:'+IntToStr((mem.dwTotalPhys div 1024 div 1024)+1)+'M RAM');
    GetDiskFreeSpace('C:',x,y,z,a);
    Add('硬盘空间:'+IntToStr((x*y*z div 1024) div 1024)+'MB');
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -