📄 unit1.pas
字号:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Registry;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
function GetExePath:String;
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
function TForm1.GetExePath:String;
begin
Result:=ExtractFilePath(ParamStr(0));
if Result[Length(Result)]<>'\' then
Result:=Result+'\';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
reg:TRegIniFile;
RegParam,BDEPath:String;
begin
RegParam:='Software';
reg:=TRegIniFile.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey(RegParam,false);
reg.CreateKey('Borland');
reg.CloseKey;
BDEPath:=GetExePath+'Bde';
RegParam:='Software\Borland';
reg.OpenKey(RegParam,false);
reg.CreateKey('Database Engine');
reg.CloseKey;
RegParam:='Software\Borland\Database Engine';
reg.OpenKey(RegParam,false);
reg.writestring(reg.FileName,'DLLPATH',BDEPath);
reg.writeString(reg.FileName,'CONFIGFILE01',BDEPath+'\IDAPI32.CFG');
reg.CloseKey;
RegParam:='Software\Borland';
reg.OpenKey(RegParam,false);
reg.CreateKey('BLW32');
reg.CloseKey;
RegParam:='Software\Borland\BLW32';
reg.OpenKey(RegParam,false);
reg.WriteString(reg.FileName,'BLAPIPATH',BDEPath);
reg.writestring(reg.FileName,'LOCALE_LIB1',BDEPath+'\fareast.btl');
reg.writestring(reg.FileName,'LOCALE_LIB2',BDEPath+'\usa.btl');
reg.CloseKey;
reg.Free;
ShowMessage('DBE Registered.');
end;
procedure TForm1.Button2Click(Sender: TObject);
var
OcxPath:String;
sComm,sParam:string;
s:String;
begin
OcxPath:=GetExePath+'ocx';
sComm:=OcxPath+'\REGSVR32.EXE';
sParam:=OcxPath+'\MSCOMM32.OCX';
s:='"'+sComm+'" "'+sParam+'"';
Winexec(PChar(s),SW_NORMAL);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -