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

📄 untadolinksetting.pas

📁 车辆管理系统
💻 PAS
字号:
unit untADOLinkSetting;

interface

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

type
  TfrmADOLinkSetting = class(TfrmBase_S)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Edit1: TEdit;
    Bevel1: TBevel;
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    Label4: TLabel;
    Edit2: TEdit;
    Edit3: TEdit;
    CheckBox1: TCheckBox;
    Bevel2: TBevel;
    Label5: TLabel;
    CheckBox2: TCheckBox;
    Label6: TLabel;
    Edit4: TEdit;
    Label7: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label8: TLabel;
    Edit5: TEdit;
    procedure Button2Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
    procedure RadioButton1Click(Sender: TObject);
    procedure RadioButton2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    procedure componenabled;
    Function f_inencrypt(sInput:string):string;
    procedure InitValue; 
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmADOLinkSetting: TfrmADOLinkSetting;

implementation

uses untGlobal;

{$R *.dfm}

procedure TfrmADOLinkSetting.Button2Click(Sender: TObject);
begin
  inherited;
  Close;
end;

procedure TfrmADOLinkSetting.componenabled;
begin
  edit2.Enabled:=not RadioButton1.Checked;
  edit3.Enabled:=not RadioButton1.Checked;
  checkbox1.Enabled:=not RadioButton1.Checked;
  if RadioButton1.Checked then
    begin
      edit2.Color:=clScrollBar;
      edit3.Color:=clScrollBar;
    end
    else
    begin
      edit2.color:=clWindow;
      edit3.color:=clWindow;
    end;
end;

procedure TfrmADOLinkSetting.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  frmADOLinkSetting:=nil;
end;

procedure TfrmADOLinkSetting.FormCreate(Sender: TObject);
begin
  inherited;
  RadioButton1.Checked:=True;
  edit4.Text:='15';
  checkbox2.Checked:=True;
  componenabled;
  InitValue;
end;

procedure TfrmADOLinkSetting.RadioButton1Click(Sender: TObject);
begin
  inherited;
  componenabled;
end;

procedure TfrmADOLinkSetting.RadioButton2Click(Sender: TObject);
begin
  inherited;
  componenabled;
end;

procedure TfrmADOLinkSetting.Button1Click(Sender: TObject);
var
  s:string;
  ini:Tinifile;
begin
  inherited;
  if trim(edit1.Text)='' then
    begin
      messagedlg('SQL Server Name Can Not Emply ',mtError,[mbok],0);
      Exit;
    end;
  if trim(edit4.Text)='' then
    begin
      messagedlg('ADO ConnectTime Can Not Emply ',mtError,[mbok],0);
      Exit;
    end;
  if trim(edit5.Text)='' then
    begin
      messagedlg('Application Name Can Not Emply ',mtError,[mbok],0);
      Exit;
    end;

  s:=GetLogDir('Log')+'adolinksetting.ini';
  try
  ini:=Tinifile.Create(s);
  ini.WriteString('Login','App Name',edit5.Text);
  ini.WriteString('Login','Server Name',edit1.Text);
  ini.WriteString('Login','ConnectTimeOut',edit4.Text);
  
  if checkbox2.Checked then
    ini.WriteString('Login','KeepConnection','True')
    else
    ini.WriteString('Login','KeepConnection','False');

  if RadioButton1.Checked then
    begin
      ini.WriteString('Login','Security Info','False');
    end
    else
    begin
      ini.WriteString('Login','Security Info','True');
      ini.WriteString('Login','User ID',edit2.Text);
      ini.WriteString('Login','LoginPrompt','True');
      ini.WriteString('Login','Password',f_inencrypt(edit3.Text));
      if not checkbox1.Checked then
        begin
          ini.WriteString('Login','LoginPrompt','False');
        end;      
    end;
  finally
  ini.Free;
  end;
  messagedlg('SQL Setting Complete,Please Reseat

⌨️ 快捷键说明

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