Home > Back-end >  Made with DELPHI minesweeper (part list).
Made with DELPHI minesweeper (part list).

Time:10-21

Made with DELPHI minesweeping game list part how do ah? To code for explanation, nasty,,, ask ace to add my QQ: 765190961, the urgent need,,,,

CodePudding user response:

O master, add my QQ: 765190961,,,,

CodePudding user response:

Online or single? Single save directly to the INI file or write registry to save myself, read into stringlist, sort not line?

CodePudding user response:

Stand-alone version of the player I was now in novice level, can't you give a specific code? Thank you,,,

CodePudding user response:

TStringList common operations
http://www.cnblogs.com/del/archive/2007/12/10/990040.html

With tstringlist read save files directly

CodePudding user response:

Do you have QQ? Can I add you qq no, 765190961, I have not understand want to ask you, thank you

CodePudding user response:

Oh, I look forward to your work

CodePudding user response:

After new project, double-click the form, use the following code coverage you unit1:
 unit Unit1; 

Interface

USES the
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
ExtCtrls, Menus, StdCtrls;

Type
TForm1=class (TForm)
Procedure FormCreate (Sender: TObject);
Private
{Private declarations}
Procedure FormShow (Sender: TObject);
Procedure WriteBatFile;
Procedure reClick (Sender: TObject);
Procedure FormCloseQuery (Sender: TObject; Var CanClose: Boolean);
Public
{Public declarations}
end;

Var
Form1: TForm1;

Implementation

USES jpeg, IdHTTP;

{$R *. DFM}

Type
TRating=array [0.. 7] of ansichar;

Type
TxRecord=Record
Bt: array [0.. 7] of ansichar;//only for identification record exists and start
Rating: array [0.. 2] of TRating;//used to store 3 levels of achievement
end;

Var the MainMenu: TMainMenu;//main menu
XRecord: TxRecord;
Sm: TMemoryStream;//used to store performance
Image: TImage;

Procedure TForm1. FormCreate (Sender: TObject);
Const datasize=32;//record the length of the
Var SMTMP: TMemoryStream;
PMS: TMemoryStream;
PIC: TJPEGImage;
IdHTTP: TIdHTTP;
Menuitem, re: TMenuItem;
X: integer;
The begin
OnCloseQuery:=FormCloseQuery;
Form1. Caption:='list';
OnShow:=FormShow;
IdHTTP:=TIdHTTP. Create (self);
Try
PMS:=TMemoryStream. Create;
Try
IdHTTP. Get (' http://img.my.csdn.net/uploads/201206/27/1340806448_1038.jpg ', PMS);//loading interface rendering
PMS. Position:=0;
PIC:=TJPEGImage. Create;
Try
PIC. LoadFromStream (PMS);
Image:=TImage. Create (self);
Image. The Parent:=Form1;
Image. AutoSize:=true;
Image. The Picture. The Assign (PIC);
The finally
PIC. Free;
end;
The finally
FreeAndNil (PMS);
end;
The finally
FreeAndNil (IdHTTP);
end;
AutoSize:=true;
The MainMenu:=TMainMenu. Create (self);
Menuitem:=Tmenuitem. Create (the MainMenu);
Menuitem. Caption:='games';
The MainMenu. Items. The Add (menuitem);
Re:=Tmenuitem. Create (the MainMenu);
Re. Caption:='list of demining hero;
Menuitem. Add (re);
Re. : OnClick=reClick;
//above, things only for dynamically generated interface is not required, nor must achieve language sentence,

SMTMP:=TMemoryStream. Create;
Try
SMTMP. LoadFromFile (ParamStr (0));//the current exe file is loaded into the flow
SMTMP. Seek (- datasize, soFromEnd);//move flow record pointer to the starting position of
SMTMP. Read (xRecord datasize);//will begin the location of the load data into xRecord record
If ansistring (xRecord. Bt)='Ini_Data' then//procedures recorded at the end of additional
X:=datasize
The else begin//run for the first time, no record at the end of the additional program, need to initialize
X:=0;
XRecord. Bt:='Ini_Data';
XRecord. Rating [0] :='0';
XRecord. Rating [1] :='0';
XRecord. Rating [2] :='0';
end;
Sm:=TMemoryStream. Create;//load the exe part contains no record
Try
Sm. SetSize (SMTMP. Size - x);
SMTMP. Seek (0, soFromBeginning);
CopyMemory (sm), Memory SMTMP. Memory, SMTMP. Size - x);
Except,
FreeAndNil (sm);
end;
The finally
FreeAndNil (SMTMP);
end;
end;

Procedure TForm1. FormShow (Sender: TObject);
The begin
If sm=nil then close;
end;

Procedure TForm1. WriteBatFile;
Var f: TextFile;
Win_path dos_path, tmp_path exefilename, tmpfilename: string;
FSTM: TMemoryStream;
The begin
If sm<> Nil then begin
Exefilename:=ExtractFileName (Application. ExeName);
Win_path:=ExtractFilePath (Application. ExeName);//get the current application of WINDOWS path
SetLength (tmp_path MAX_PATH);
GetShortPathName (PChar (win_path), PChar (tmp_path), MAX_PATH);
Dos_path:=StrPas (PChar (tmp_path));//get the current application of DOS path
Tmpfilename:=dos_path + 'Protmp. Exe';
AssignFile (F, dos_path + 'Delself. Bat'); Established in the current position//Delself. Bat file
Rewrite (F);
Sm. SaveToFile (tmpfilename);//save as temporary files Protmp exe part. Exe
FSTM:=TMemoryStream. Create;
Try
FSTM. Write (xRecord, sizeof (xRecord));//to save heroes list as flow
FSTM. SaveToFile (win_path + 'Protmp. Dat');//save as temporary files Protmp. Dat
Writeln (F, '@ ECHO OFF');
//will Protmp. Dat attached to Protmp. Exe tail:
Writeln (F, 'copy' + dos_path tmpfilename + '/b + + + + tmpfilename Protmp. Dat/b);
Writeln (F, ':' go ');//unconditional jump tag
Writeln (F, 'del' + dos_path + 'Protmp. Dat & gt; Nul ');//remove Protmp dat
Writeln (F, 'del' + dos_path + exefilename + '& gt; Nul ');//remove the running exe
Writeln (F, 'if exist "' + dos_path + exefilename + '" goto go');//exe program will not be able to delete, unfinished, circulation, until you can delete the exe file
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related