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

📄 inputpassform.pas

📁 明小子旁注Domain3.0和Domain2.2两个版本源码
💻 PAS
字号:
{##########################################
         旁注入侵专用程序 3.0升级版
 -----------------------------------------
  模块:浏览数据库 - 输入访问密码
  作者:2005.3.26日晚  明小子
##########################################}

unit InputPassForm;

interface

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

type
  TInputPassFrm = class(TForm)
    Label1: TLabel;
    Label3: TLabel;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    DataPath: TEdit;
    DataPwd: TEdit;
    StatusBar1: TStatusBar;
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

const
  DBPath = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=';
  DBPass = ';Persist Security Info=False;Jet OLEDB:Database Password=';

var
  InputPassFrm: TInputPassFrm;

implementation

uses MainUnit;

{$R *.dfm}

procedure TInputPassFrm.SpeedButton2Click(Sender: TObject);
var
  Tables: TStrings; {储蓄所有表名}
  FilePath: string;
  TN: TTreeNode;
  i: integer;
begin
  try
    if FileExists(DataPath.Text) = False then
    begin
      application.MessageBox('请确认数据库文件路径是否正确!', '提示', 48);
      Exit;
    end;
    FilePath := DataPath.Text;
    if FilePath = '' then Exit; {空则退出}
    Tables := TStringList.Create; {用来保存表名}
    MainForm.ADOCon.Close;
    MainForm.ADOCon.ConnectionString := DBPath + FilePath + DBPass + DataPwd.Text; {组合路径}

    try
      MainForm.ADOCon.Open;
    except
      application.MessageBox('你输入的数据库访问密码不正确,请重新输入!', '错误提示', 32);
      Exit;
    end;
    MainForm.TableTree.Items.Clear;

    try
      MainForm.FieldsTree.Items.Clear; {清空FieldsTree里的字段}
    except
    end;
    MainForm.ADOCon.GetTableNames(Tables); {将所有表名保存到Tables中}

    for i := 0 to Tables.Count - 1 do {历遍查询Tables中的每个表名}
    begin
      TN := MainForm.TableTree.Items.Add(nil, Tables.Strings[i]);
      while not MainForm.ADOQuery1.Eof do
      begin
        MainForm.TableTree.Items.AddChild(TN, Tables.Strings[i]); {将所有表名保存到TableTree的每个节点中}
        MainForm.ADOQuery1.Next;
      end;
    end;

    MainForm.btnQueryFirst.Enabled := True;
    MainForm.btnQueryPrior.Enabled := True;
    MainForm.btnQueryNext.Enabled := True;
    MainForm.btnQueryLast.Enabled := True;
    MainForm.Pane1.Caption := '共有:' + inttostr(MainForm.TableTree.Items.Count) + '个数据表';
    Tables.Free;

  except
    Tables.Free;
  end;
  
  InputPassFrm.Hide;
end;

procedure TInputPassFrm.SpeedButton3Click(Sender: TObject);
begin
  Close;
end;

procedure TInputPassFrm.FormShow(Sender: TObject);
begin
  DataPath.Text := MainForm.Data_FilePath;
end;

end.

⌨️ 快捷键说明

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