PRAKTIKUM BSI DELPHI 7 IV


NAMA : LOURENS ROBERTO LOUKASSY
KELAS : 13.6B.01
NIM : 13090318
TUGAS : BORLAND DELPHI 7 ADVANCED

CODING >>>>>>>>PROGRAM HIDDEN<<<<<

Untuk Form1
-------------------------------------------------------------------------------------------------------------------------------------
unit Latihan4;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, FileCtrl, Buttons, ExtCtrls, Menus;

type
  TForm1 = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    DirectoryListBox1: TDirectoryListBox;
    FileListBox1: TFileListBox;
    DriveComboBox1: TDriveComboBox;
    Bevel1: TBevel;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    BitBtn3: TBitBtn;
    GroupBox1: TGroupBox;
    CheckBox1: TCheckBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    MainMenu1: TMainMenu;
    File1: TMenuItem;
    Exit1: TMenuItem;
    BSIToolsHidden1: TMenuItem;
    ShowHidden1: TMenuItem;
    GroupBox2: TGroupBox;
    BitBtn4: TBitBtn;
    BitBtn5: TBitBtn;
    BitBtn6: TBitBtn;
    BitBtn7: TBitBtn;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FileListBox1DblClick(Sender: TObject);
    procedure BitBtn3Click(Sender: TObject);
    procedure BitBtn4Click(Sender: TObject);
    procedure BitBtn5Click(Sender: TObject);
    procedure BitBtn6Click(Sender: TObject);
    procedure BitBtn7Click(Sender: TObject);
    procedure ShowHidden1Click(Sender: TObject);
    procedure Exit1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Latihan4_Form2;
Var NamaFile:String;
Attribut:Integer;

{$R *.dfm}

procedure TForm1.BitBtn1Click(Sender: TObject);
begin
NamaFile:=Edit1.Text;
attribut:=FileGetAttr(NamaFile);

  If Attribut And faReadOnly = faReadOnly Then
  CheckBox1.Checked :=True
  Else
  CheckBox1.Checked :=False;


  If Attribut And faHidden = faHidden Then
  CheckBox2.Checked :=True
  Else
  CheckBox2.Checked:=False;


  If Attribut And faSysFile = faSysFile Then
  CheckBox3.Checked :=True
  Else
  CheckBox3.Checked :=False;

end;

procedure TForm1.BitBtn2Click(Sender: TObject);
begin
If CheckBox1.Checked = True Then
Attribut :=Attribut or faReadOnly;

If CheckBox2.Checked = True Then
Attribut :=Attribut or faHidden;

If CheckBox3.Checked = True Then
Attribut :=Attribut or faSysFile;


FileSetAttr(NamaFile,Attribut);

end;

procedure TForm1.FileListBox1DblClick(Sender: TObject);
begin
BitBtn1Click(Self);
end;

procedure TForm1.BitBtn3Click(Sender: TObject);
begin
Application.Terminate;
end;


procedure TForm1.BitBtn4Click(Sender: TObject);
begin
NamaFile:=Edit1.Text;
attribut:=FileGetAttr(NamaFile);

  If Attribut And faReadOnly = faReadOnly Then
  CheckBox1.Checked :=False
  Else
  CheckBox1.Checked :=False;


  If Attribut And faHidden = faHidden Then
  CheckBox2.Checked :=False
  Else
  CheckBox2.Checked:=False;


  If Attribut And faSysFile = faSysFile Then
  CheckBox3.Checked :=False
  Else
  CheckBox3.Checked :=False;
end;

procedure TForm1.BitBtn5Click(Sender: TObject);
begin

If CheckBox1.Checked = false Then
Attribut :=Attribut-faReadOnly;

FileSetAttr(NamaFile,Attribut);

end;

procedure TForm1.BitBtn6Click(Sender: TObject);
begin
If CheckBox2.Checked = false Then
Attribut :=Attribut-faHidden;

FileSetAttr(NamaFile,Attribut);

end;

procedure TForm1.BitBtn7Click(Sender: TObject);
begin
If CheckBox3.Checked = false Then
Attribut :=Attribut-faSysFile;

FileSetAttr(NamaFile,Attribut);

end;

procedure TForm1.ShowHidden1Click(Sender: TObject);
begin
Form2.Show;
end;

procedure TForm1.Exit1Click(Sender: TObject);
begin
Application.Terminate;
end;

end.

--------------------------------------------------------------------------------------------------------------------------------
Untuk Form2
unit Latihan4_Form2;

interface

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

type
  TForm2 = class(TForm)
    Image1: TImage;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

uses Latihan4;
Var NamaFile:String;
Attribut:Integer;

{$R *.dfm}


procedure TForm2.FormCreate(Sender: TObject);
begin
Memo1.Clear;
Memo1.Enabled :=False;
Memo1.Text:=' BINA SARANA INFORMATIKA AMIK JURUSAN TEKNIK KOMPUTER 13.6B.01 (13090318) ';
end;

end.


Screen Shut Programnya : 



Silahkan Download Project Latihan 4....
Download Project LATIHA4_DELPHI7_BSI

Komentar

Postingan populer dari blog ini

SOURCE CODING MP3 PALYER by Lhourens

WebCam Sederhana Menggunakan Pemrograman Delphi

Membuat Aplikasi Database Delphi Berbasis Cloud Database