unit TypeConfig;

interface

uses
  Classes, Forms, Windows;

const
  cfgTypeFile = 'Type.txt';
  Flag_Version_0 = 0;

type
  TCfgType = class
  private
    FVersion_0: string;
    FStrList: TStringList;
  public
    constructor Create;
    destructor Destroy; override;

    function GetAppType(const AType: Integer): string;

    property Version_0: string read FVersion_0;
  end;

var
  CfgManager: TCfgType;

implementation

uses SysUtils;

{ TCfgType }

constructor TCfgType.Create;
var
  I: Integer;
  sName: string;
begin
  FStrList := TStringList.Create;
  sName := ExtractFilePath(Application.ExeName);
  sName := sName + cfgTypeFile;
  if FileExists(sName) then
  begin
    FStrList.LoadFromFile(sName);
    FVersion_0 := FStrList.Strings[0];
  end
  else
  begin
    FVersion_0 := '°æ±¾0';
  end;
end;

destructor TCfgType.Destroy;
begin
  FStrList.Free;
  inherited;
end;

function TCfgType.GetAppType(const AType: Integer): string;
begin
  if AType = Flag_Version_0 then
    Result := FVersion_0;
end;

initialization
  CfgManager := TCfgType.Create;

finalization
  CfgManager.Free;

end.
