1, ShellExecute "Use Shellapi"
' Open ' ' http://www.cnblogs.com/lovelp/ ' Nil Nil, sw_show);
2, about the path
Expandfilename () returns the full path of the file (with drive, path)  
Extractfileext () extracts the extension from the file name Span class= "Apple-converted-space" > 
Extractfilename () extracts a file name without a path from the file name  
Extractfilepath () Extract path name from file name Extractfiledir () extracts the directory name from the file name  
Extractfiledrive () Extract the drive name from the file name  
Changefileext () to change the file name extension  
Expanduncfilename () returns the full path of the file containing the network drive  
Extractrelativepath () extracts relative path information from the file name  
Extractshortpathname () Convert file names to DOS 8 3 format  
Matchesmask () checks if the file matches the specified file name format
3 common ways to get the current path:
Extractfilepath (Paramstr (0'\';
3, the format of time
FormatDateTime ('yyyy-mm-dd', Now ());
4. Extracting Time components
Yearofmonthofweekofdayofhourofminuteofsecondof
5. INI operation
varInifile:tinifile; //Creating ObjectsInifile:=tinifile.create (inifilepath+inifilename);//Read DataInifile.readstring (' Section','Key','DefaultValue')//stringInifile.readinteger (' Section','Key', DefaultValue);//integer //Write DataInifile.writestring (' Section','Key','Value')//stringInifile.writeinteger (' Section','Key', tValue);//Releasing ObjectsInifile.free;//If you want to read the entire value, you can use Inifile.readsection (' sectionname ', stringlist) to read the whole piece of data into the Tstringlist object
6. Read and write the registration form "Use Registry"
procedureTform1.button1click (sender:tobject);varReg:tregistry;beginReg:=tregistry.create;//Create an instanceReg. Rootkey:=hkey_current_user;//Specify the primary key for the registry that needs to be manipulated if(Reg. Openkey ('Software\dsy', true)) Then beginReg. WriteString ('Fishname','Freshwater Fish');//writes a string type, or it can be another typeReg. Closekey; End; Reg. Free;End;procedureTform1.button2click (sender:tobject);varReg:tregistry;beginReg:=tregistry.create;//Create an instanceReg. Rootkey:=hkey_current_user;//Specify the primary key for the registry that needs to be manipulated if(Reg. Openkey ('Software\dsy', true)) Then beginShowMessage (Reg. ReadString ('Fishname'));//read the registration formReg. Closekey; End; Reg. Free;End;
View Code
Win32 Common Code collation