Вообщем
Unit1:
Код:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Menus, sSkinManager, sDialogs, StdCtrls, sEdit, sMemo, sLabel,
sSpinEdit, ShellApi, IniFiles, sComboBox;
type
TForm1 = class(TForm)
sSkinManager1: TsSkinManager;
MainMenu1: TMainMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N8: TMenuItem;
N9: TMenuItem;
N10: TMenuItem;
sEdit1: TsEdit;
sEdit2: TsEdit;
sEdit3: TsEdit;
sMemo1: TsMemo;
sEdit4: TsEdit;
sLabelFX1: TsLabelFX;
sLabelFX2: TsLabelFX;
sLabelFX3: TsLabelFX;
sLabelFX4: TsLabelFX;
sLabelFX5: TsLabelFX;
sLabelFX6: TsLabelFX;
sLabelFX7: TsLabelFX;
sSpinEdit1: TsSpinEdit;
sSpinEdit2: TsSpinEdit;
sSpinEdit3: TsSpinEdit;
sLabelFX8: TsLabelFX;
sEdit5: TsEdit;
sLabelFX9: TsLabelFX;
sComboBox1: TsComboBox;
procedure FormCreate(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N7Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure sComboBox1Change(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
unreg,reg:string;
implementation
uses Unit2, Unit3;
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
unreg:='(trial version)';
reg:='(register version)';
if FileExists(ExtractFilePath(Application.ExeName) + 'key.ccbf') then
begin
Form3.sMemo1.Lines.LoadFromFile(ExtractFilePath(ParamStr(0)) + 'key.ccbf');
Form3.sBitBtn1.Click;
end;
end;
procedure TForm1.N5Click(Sender: TObject);
begin
Application.Terminate;
end;
procedure TForm1.N7Click(Sender: TObject);
begin
Application.MessageBox('1. Wank :)','Creating a batch file',mb_iconinformation or mb_ok);
end;
procedure TForm1.N2Click(Sender: TObject);
begin
sMemo1.Lines.Text:='@echo off'+#13#10+
'cls'+#13#10+
'echo '+sedit1.Text+#13#10+
'echo '+sedit2.text+#13#10+
'title '+sedit4.text+#13#10+
':srcds'+#13#10+
':loop'+#13#10+
'echo (%date% %time%) srcds started.'+#13#10+
'start /wait '+sEdit3.Text+' -console -game cstrike -tickrate '+inttostr(sSpinEdit1.Value)+' -port '+inttostr(sSpinEdit2.Value)+' +fps_max 600 +maxplayers '+inttostr(sSpinEdit3.Value)+' +map '+sEdit5.text+#13#10+
'goto srcds'+#13#10+
'echo (%date% %time%) WARNING: srcds closed or crashed, restarting.'+#13#10+
'goto loop';
sMemo1.Lines.SaveToFile('Start.bat');
ShowMessage('File was saved in a folder with the program!');
end;
procedure TForm1.N10Click(Sender: TObject);
begin
Form3.Show;
end;
procedure TForm1.N8Click(Sender: TObject);
begin
Form2.Show;
end;
procedure TForm1.N3Click(Sender: TObject);
begin
ShellExecute(Handle,'Open',Pchar('Start.bat'),nil,nil,1);
end;
procedure TForm1.sComboBox1Change(Sender: TObject);
var
Ini: TIniFile;
begin
case sComboBox1.ItemIndex of
0: Ini := TIniFile.Create(ExtractFilePath(Paramstr(0)) + 'english.lng');
1: Ini := TIniFile.Create(ExtractFilePath(Paramstr(0)) + 'russian.lng')
end;
sLabelFX1.Caption := Ini.ReadString('CaptionsForm1', 'Label1', '...');
sLabelFX2.Caption := Ini.ReadString('CaptionsForm1', 'Label2', '...');
sLabelFX3.Caption := Ini.ReadString('CaptionsForm1', 'Label3', '...');
sLabelFX4.Caption := Ini.ReadString('CaptionsForm1', 'Label4', '...');
sLabelFX5.Caption := Ini.ReadString('CaptionsForm1', 'Label5', '...');
sLabelFX6.Caption := Ini.ReadString('CaptionsForm1', 'Label6', '...');
sLabelFX7.Caption := Ini.ReadString('CaptionsForm1', 'Label7', '...');
sLabelFX8.Caption := Ini.ReadString('CaptionsForm1', 'Label8', '...');
sLabelFX9.Caption := Ini.ReadString('CaptionsForm1', 'Label9', '...');
N1.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu1', '...');
N6.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu2', '...');
N9.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu3', '...');
N2.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu4', '...');
N3.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu5', '...');
N5.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu6', '...');
N8.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu7', '...');
N10.Caption := Ini.ReadString('CaptionsForm1', 'MainMenu8', '...');
Form2.Caption := Ini.ReadString('CaptionsForm2', 'FormCap', '...');
Form3.Caption := Ini.ReadString('CaptionsForm3', 'FormCap', '...');
Form3.sBitBtn1.Caption := Ini.ReadString('CaptionsForm3', 'BitBtnCap', '...');
Form3.sLabelFX1.Caption := Ini.ReadString('CaptionsForm3', 'Labelfx1', '...');
Form3.sLabelFX2.Caption := Ini.ReadString('CaptionsForm3', 'Labelfx2', '...');
Ini.Free;
end;
end.
Unit2:
Код:
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, sLabel;
type
TForm2 = class(TForm)
sLabelFX1: TsLabelFX;
sLabelFX2: TsLabelFX;
sLabel1: TsLabel;
sWebLabel1: TsWebLabel;
sWebLabel2: TsWebLabel;
sLabelFX3: TsLabelFX;
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
end.
Unit3:
Код:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, sBevel, StdCtrls, sEdit, sLabel, acPNG, Buttons,
sBitBtn, IniFiles, sMemo;
type
TForm3 = class(TForm)
Image1: TImage;
sLabelFX1: TsLabelFX;
sLabelFX2: TsLabelFX;
sBevel1: TsBevel;
sBitBtn1: TsBitBtn;
sMemo1: TsMemo;
procedure sBitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form3: TForm3;
regkey:string;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm3.sBitBtn1Click(Sender: TObject);
begin
regkey:='0397563126378129337615312802380987125312';
if sMemo1.Lines.Text='' then
begin
Application.MessageBox('You have not entered the key!','Error', mb_iconstop or mb_ok);
end;
if sMemo1.Lines.Text<>regkey then
begin
Application.MessageBox('You entered the wrong key!','Error',mb_iconwarning or mb_ok)
end
else
begin
Application.MessageBox('You are entering the correct key! Thank you for using the program! Happy New Year 2011:)','Correct key', mb_iconinformation or mb_ok);
Form1.N3.Enabled:=true;
Form1.sEdit4.Enabled:=true;
Form1.sEdit1.Enabled:=true;
Form1.sEdit2.Enabled:=true;
sMemo1.Lines.SaveToFile(ExtractFilePath(ParamStr(0)) + 'key.ccbf');
end;
end;
end.
__________________
Начинающий Delphi
Помогаю за Спасибо!
|