RTFormwork/项目代码/RTBasicsV1/A05基础资料管理/U_iniParam.pas

66 lines
2.0 KiB
ObjectPascal
Raw Permalink Normal View History

2024-07-07 09:35:27 +08:00
unit U_iniParam;
interface
uses
IniFiles,SysUtils;
var
Filename:string; //<2F>ļ<EFBFBD><C4BC><EFBFBD>
iParam2:integer;
bParam1:Boolean;
bParam2:Boolean;
SCXFlag:String; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ݴ˱<DDB4>־<EFBFBD><D6BE>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ׺ <20><><EFBFBD>ܰ<EFBFBD><DCB0><EFBFBD><EFBFBD><EFBFBD>ĸ 1,2
SCXCount:String; //<2F><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>
PortNoStr:string;//<2F>˿ں<CBBF>
DllName:string;//<2F>˿<EFBFBD>Dll<6C>ļ<EFBFBD>
Function IsINIFile():Boolean; //<2F>ж<EFBFBD>InI<6E><49><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
procedure ReadINIFile();
procedure WriteINIFile();
implementation
///////////////////////////////////////////////////////////////////
//<2F><>ȡini<6E>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ò<EFBFBD><C3B2><EFBFBD>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
////////////////////////////////////////////////////////////////////
procedure ReadINIFile();
var
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
begin
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
programIni:=Tinifile.create(FileName);
SCXFlag:=programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>־','1');
SCXCount:=programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>','1');
PortNoStr:=programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>˿ں<CBBF>','com1');
DllName:=programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>˿<EFBFBD>Dll<6C>ļ<EFBFBD>','JZCRS323C.DLL');
programIni.Free;
end;
//////////////////////////////////////////////////////////////////
//д<><D0B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2>INI<4E>ļ<EFBFBD>
//<2F><><EFBFBD><EFBFBD>
//////////////////////////////////////////////////////////////////
procedure WriteINIFile();
var
programIni:Tinifile; //<2F><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>
begin
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
programIni:=Tinifile.create(FileName);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̨<EFBFBD><CCA8>־',SCXFlag);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27><>̨<EFBFBD><CCA8><EFBFBD><EFBFBD>',SCXCount);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>˿ں<CBBF>',PortNoStr);
programIni.WriteString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>','<27>˿<EFBFBD>Dll<6C>ļ<EFBFBD>',DllName);
programIni.Free;
end;
//////////////////////////////////////////////////////////////////
//<2F>ж<EFBFBD>InI<6E>ļ<EFBFBD><C4BC>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
//////////////////////////////////////////////////////////////////
Function IsINIFile():Boolean;
begin
FileName:=ExtractFilePath(Paramstr(0))+'File.INI';
if FileExists(FileName) then
Result:=true
else
Result:=false;
end;
end.