RTFormwork/项目代码/RTBasicsV1/F02染色计划单/U_iniParam.pas

78 lines
2.3 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>
DZCDYDllName: string; //<2F><><EFBFBD>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>
MBDYDllName: string; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><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');
DZCDYDllName := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD>ӳӵ<D3B3><D3B5><EFBFBD>Dll<6C>ļ<EFBFBD>', '');
MBDYDllName := programIni.ReadString('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>', '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Dll<6C>ļ<EFBFBD>', '');
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.