program Measure_Cloud;

uses
  Windows,
  ShareMem,
  Forms,
  Controls,
  HttpApp,
  MainFrm in '..\..\Forms\MainFrm.pas' {MainForm},
  ProjectManagerFme in '..\..\Frames\ProjectManagerFme.pas' {ProjectManagerFrame: TFrame},
  UtilMethods in '..\..\Units\UtilMethods.pas',
  ProjectManagerDm in '..\..\DataModules\ProjectManagerDm.pas' {ProjectManagerData: TDataModule},
  Connections in '..\..\Units\Connections.pas',
  TransFile in '..\..\Units\TransFile.pas',
  ZhAPI in '..\..\Units\ZhAPI.pas',
  CompactDB in '..\..\Units\CompactDB.pas',
  OpenProjectManager in '..\..\Units\OpenProjectManager.pas',
  ProjectData in '..\..\Units\ProjectData.pas',
  UpdateDataBase in '..\..\Units\UpdateDataBase.pas',
  DataBaseTables in '..\..\Units\DataBaseTables.pas',
  ConfigDoc in '..\..\Units\ConfigDoc.pas',
  SupportUnit in '..\..\Units\SupportUnit.pas',
  StandardLibs in '..\..\Units\StandardLibs.pas',
  StandardLib in '..\..\Units\StandardLib.pas',
  NewProjectFrm in '..\..\Forms\NewProjectFrm.pas' {NewProjectForm},
  ProjectFme in '..\..\Frames\ProjectFme.pas' {ProjectFrame: TFrame},
  StandardBillsDm in '..\..\DataModules\StandardBillsDm.pas' {StandardBillsData: TDataModule},
  StandardBillsFme in '..\..\Frames\StandardBillsFme.pas' {StandardBillsFrame: TFrame},
  StandardLibsFme in '..\..\Frames\StandardLibsFme.pas' {StandardLibsFrame: TFrame},
  BillsDm in '..\..\DataModules\BillsDm.pas' {BillsData: TDataModule},
  Globals in '..\..\Units\Globals.pas',
  StageDm in '..\..\DataModules\StageDm.pas' {StageData: TDataModule},
  ExcelImport in '..\..\Units\ExcelImport.pas',
  CacheTree in '..\..\Units\CacheTree.pas',
  MCacheTree in '..\..\Units\MCacheTree.pas',
  ProjectPropertiesFrm in '..\..\Forms\ProjectPropertiesFrm.pas' {ProjectPropertiesForm},
  ProjectProperty in '..\..\Units\ProjectProperty.pas',
  FormulaCalc in '..\..\Units\FormulaCalc.pas',
  BillsCommand in '..\..\Units\BillsCommand.pas',
  PhaseData in '..\..\Units\PhaseData.pas',
  PhaseProperty in '..\..\Units\PhaseProperty.pas',
  BillsClipboard in '..\..\Units\BillsClipboard.pas',
  BillsTree in '..\..\Units\BillsTree.pas',
  ProjectCommands in '..\..\Units\ProjectCommands.pas',
  PhaseCompareDm in '..\..\DataModules\PhaseCompareDm.pas' {PhaseCompareData: TDataModule},
  PhaseCompareFme in '..\..\Frames\PhaseCompareFme.pas' {PhaseCompareFrame: TFrame},
  OptionFrm in '..\..\Forms\OptionFrm.pas' {OptionForm},
  DealPaymentDm in '..\..\DataModules\DealPaymentDm.pas' {DealPaymentData: TDataModule},
  DealPaymentFme in '..\..\Frames\DealPaymentFme.pas' {DealPaymentFrame: TFrame},
  PhasePayDm in '..\..\DataModules\PhasePayDm.pas' {PhasePayData: TDataModule},
  ZJJLDm in '..\..\DataModules\ZJJLDm.pas' {ZJJLData: TDataModule},
  BillsGatherDm in '..\..\DataModules\BillsGatherDm.pas' {BillsGatherData: TDataModule},
  BillsGatherFme in '..\..\Frames\BillsGatherFme.pas' {BillsGatherFrame: TFrame},
  LoginFrm in '..\..\Forms\LoginFrm.pas' {LoginFrm},
  PHPWebDm in '..\..\DataModules\PHPWebDm.pas' {PHPWeb: TDataModule},
  MD5Unit in '..\..\Units\MD5Unit.pas',
  ConstUnit in '..\..\Units\ConstUnit.pas',
  ExportExcel in '..\..\Units\ExportExcel.pas',
  mEncryptEditions in '..\..\Encrypt\mEncryptEditions.pas',
  mEncryptUnit in '..\..\Encrypt\mEncryptUnit.pas',
  CryptUtils in '..\..\Encrypt\CryptUtils.pas',
  EncryptDog in '..\..\Encrypt\EncryptDog.pas',
  mEncryptPWD in '..\..\Encrypt\mEncryptPWD.pas',
  mEncryptTypes in '..\..\Encrypt\mEncryptTypes.pas',
  mR1Encrypt in '..\..\Encrypt\mR1Encrypt.pas',
  mS4Utils in '..\..\Encrypt\mS4Utils.pas',
  mSNSEncrypt in '..\..\Encrypt\mSNSEncrypt.pas',
  Rockey1 in '..\..\Encrypt\Rockey1.pas',
  mConnectEncrypt in '..\..\Encrypt\NetClient\mConnectEncrypt.pas',
  FindUserFrm in '..\..\Forms\FindUserFrm.pas' {FindUserForm},
  CslJson in '..\..\Units\CslJson.pas',
  OrderCheckerFme in '..\..\Frames\OrderCheckerFme.pas' {OrderCheckerFrame: TFrame},
  CheckerFme in '..\..\Frames\CheckerFme.pas' {CheckerFrame: TFrame},
  WebNewTenderFrm in '..\..\Forms\WebNewTenderFrm.pas' {WebNewTenderForm},
  ScFileArchiver in '..\..\Encrypt\ScFileArchiver.pas',
  SearchDm in '..\..\DataModules\SearchDm.pas' {SearchData: TDataModule},
  DealBillsDm in '..\..\DataModules\DealBillsDm.pas' {DealBillsData: TDataModule},
  BGLDm in '..\..\DataModules\BGLDm.pas' {BGLData: TDataModule},
  StaffDm in '..\..\DataModules\StaffDm.pas' {StaffData: TDataModule},
  BillsCompileDm in '..\..\DataModules\BillsCompileDm.pas' {BillsCompileData: TDataModule},
  BillsMeasureDm in '..\..\DataModules\BillsMeasureDm.pas' {BillsMeasureData: TDataModule},
  ReportManager in '..\..\Units\ReportManager.pas',
  BGLSelectFrm in '..\..\Forms\BGLSelectFrm.pas' {BGLSelectForm},
  BillsCompileFme in '..\..\Frames\BillsCompileFme.pas' {BillsCompileFrame: TFrame},
  BillsMeasureFme in '..\..\Frames\BillsMeasureFme.pas' {BillsMeasureFrame: TFrame},
  BatchReplaceBillsFrm in '..\..\Forms\BatchReplaceBillsFrm.pas' {BatchReplaceBillsForm},
  ZJJLFme in '..\..\Frames\ZJJLFme.pas' {ZJJLFrame: TFrame},
  BGLFme in '..\..\Frames\BGLFme.pas' {BGLFrame: TFrame},
  MergeTextFrm in '..\..\Forms\MergeTextFrm.pas' {MergeTextForm},
  ReportsFrm in '..\..\Forms\ReportsFrm.pas' {ReportsForm},
  ReportAdjustFrm in '..\..\Forms\ReportAdjustFrm.pas' {ReportAdjustForm},
  SearchFme in '..\..\Frames\SearchFme.pas' {SearchFrame: TFrame},
  AuthFrm in '..\..\Forms\AuthFrm.pas' {AuthorizeForm},
  AboutFrm in '..\..\Forms\AboutFrm.pas' {AboutForm},
  ImportExcelHintFrm in '..\..\Forms\ImportExcelHintFrm.pas' {ImportExcelHintForm},
  PasswordInputFrm in '..\..\Forms\PasswordInputFrm.pas' {PasswordInputForm},
  BatchInsertBillsFrm in '..\..\Forms\BatchInsertBillsFrm.pas' {BatchInsertBillsForm},
  MainDataListDm in '..\..\DataModules\MainDataListDm.pas' {MainListData: TDataModule},
  mProgressFrm in '..\..\Forms\mProgressFrm.pas' {mProgress},
  rmGclBillsBGDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsBGDm.pas' {rmGclBillsBGData: TDataModule},
  rmGclBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsCompareDm.pas' {rmGclBillsCompareData: TDataModule},
  rmBGLExecutionDm in '..\..\DataModules\ReportMemoryDm\rmBGLExecutionDm.pas' {rmBGLExecutionData: TDataModule},
  rmBillsGatherDm in '..\..\DataModules\ReportMemoryDm\rmBillsGatherDm.pas' {rmBillsGatherData: TDataModule},
  rmFxBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsAddDm.pas' {rmFxBillsAddData: TDataModule},
  rmFxBillsCompareDm in '..\..\DataModules\ReportMemoryDm\rmFxBillsCompareDm.pas' {rmFxBillsCompareData: TDataModule},
  rmGclBillsAddDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAddDm.pas' {rmGclBillsAddData: TDataModule},
  rmGridHeaderDm in '..\..\DataModules\ReportMemoryDm\rmGridHeaderDm.pas' {rmGridHeaderData: TDataModule},
  rmCacheData in '..\..\DataModules\ReportMemoryDm\rmCacheData.pas',
  rmSelectProjectFrm in '..\..\Forms\rmSelectProjectFrm.pas' {ProjectSelectForm},
  ConditionalDefines in '..\..\Units\ConditionalDefines.pas',
  ProgressHintFrm in '..\..\Forms\ProgressHintFrm.pas' {ProgressHintForm},
  CheckAndClearFrm in '..\..\Forms\CheckAndClearFrm.pas' {CheckAndClearForm},
  rmGclBillsAuditCompareDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsAuditCompareDm.pas' {rmGclBillsAuditCompareData: TDataModule},
  rmTestFrm in '..\..\DataModules\ReportMemoryDm\rmTestFrm.pas' {rmTestForm},
  DealBillsFrm in '..\..\Forms\DealBillsFrm.pas' {DealBillsForm},
  TenderBackupFrm in '..\..\Forms\TenderBackupFrm.pas' {TenderBackupForm},
  TenderBackupDm in '..\..\DataModules\TenderBackupDm.pas' {TenderBackupData: TDataModule},
  BillsBookmarkDm in '..\..\DataModules\BillsBookmarkDm.pas' {BillsBookmarkData: TDataModule},
  BookmarkFme in '..\..\Frames\BookmarkFme.pas' {BookmarkFrame: TFrame},
  rmDealInfosDm in '..\..\DataModules\ReportMemoryDm\rmDealInfosDm.pas' {rmDealInfosData: TDataModule},
  rmXmjBGLDetailDm in '..\..\DataModules\ReportMemoryDm\rmXmjBGLDetailDm.pas' {rmXmjBGLDetailData: TDataModule},
  WelcomeFrm in '..\..\Forms\WelcomeFrm.pas' {WelcomeForm},
  rmOtherReport1Dm in '..\..\DataModules\ReportMemoryDm\rmOtherReport1Dm.pas' {rmOtherReport1Data: TDataModule},
  CheckerMemoFrm in '..\..\Forms\CheckerMemoFrm.pas' {CheckerMemoForm},
  CslHint in '..\..\Units\CslHint.pas',
  IPFrm in '..\..\Forms\IPFrm.pas' {IPForm},
  TenderBackupManager in '..\..\Units\TenderBackupManager.pas',
  UpFileManageUnit in '..\..\Units\UpFileManageUnit.pas',
  UpFileFrame in '..\..\Forms\UpFileFrame.pas',
  UpFileManageFrame in '..\..\Forms\UpFileManageFrame.pas',
  SheetSelectFrm in '..\..\Forms\SheetSelectFrm.pas' {SheetSelectForm},
  ReportInteractInfo in '..\..\Units\ReportInteractInfo.pas',
  Checker in '..\..\Units\Checker.pas',
  AuditSelectFrm in '..\..\Forms\ReportInteractFrms\AuditSelectFrm.pas' {AuditSelctForm},
  DealBillsFme in '..\..\Frames\DealBillsFme.pas' {DealBillsFrame: TFrame},
  rmGclBillsPlaneDm in '..\..\DataModules\ReportMemoryDm\rmGclBillsPlaneDm.pas' {rmGclBillsPlaneData: TDataModule},
  StageCompareDm in '..\..\DataModules\StageCompareDm.pas' {StageCompareData: TDataModule},
  mDataRecord in '..\..\Units\mDataRecord.pas',
  BGLClipboard in '..\..\Units\BGLClipboard.pas',
  rmMentalCustomized1Dm in '..\..\DataModules\ReportMemoryDm\rmMentalCustomized1Dm.pas' {rmMentalCustomized1Data: TDataModule},
  rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
  rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
  CalcDecimal in '..\..\Units\CalcDecimal.pas',
  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
  DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
  GclBillsGatherModel in '..\..\Units\GclBillsGatherModel.pas',
  PriceMarginBillsDm in '..\..\DataModules\PriceMarginBillsDm.pas' {PriceMarginBillsData: TDataModule},
  ProjectGLDm in '..\..\DataModules\ProjectGLDm.pas' {ProjectGLData: TDataModule},
  PriceMarginBillsFme in '..\..\Frames\PriceMarginBillsFme.pas' {PriceMarginBillsFrame: TFrame},
  PriceMarginFme in '..\..\Frames\PriceMarginFme.pas' {PriceMarginFrame: TFrame},
  ProjectGLFme in '..\..\Frames\ProjectGLFme.pas' {ProjectGLFrame: TFrame},
  DetailGLDm in '..\..\DataModules\DetailGLDm.pas' {DetailGLData: TDataModule},
  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
  BaseClipboard in '..\..\Units\BaseClipboard.pas',
  SelectDetailGLsFrm in '..\..\Forms\SelectDetailGLsFrm.pas' {SelectDetailGLsForm},
  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm},
  mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm},
  tpMainFrm in '..\..\TenderPartition\tpMainFrm.pas' {tpMainForm},
  tpBaseGatherData in '..\..\TenderPartition\tpBaseGatherData.pas',
  tpGatherGcl in '..\..\TenderPartition\tpGatherGcl.pas',
  tpGatherTree in '..\..\TenderPartition\tpGatherTree.pas',
  tpMainData in '..\..\TenderPartition\tpMainData.pas',
  tpNoPegDm in '..\..\TenderPartition\tpNoPegDm.pas' {tpNoPegData: TDataModule},
  tpPartTender in '..\..\TenderPartition\tpPartTender.pas',
  tpPartTenderFme in '..\..\TenderPartition\tpPartTenderFme.pas' {tpPartTenderFrame: TFrame},
  tpPartTenderSet in '..\..\TenderPartition\tpPartTenderSet.pas',
  tpPartTenderSetFme in '..\..\TenderPartition\tpPartTenderSetFme.pas' {tpPartTenderSetFrame: TFrame},
  tpPeg in '..\..\TenderPartition\tpPeg.pas',
  tpPeg_GclDm in '..\..\TenderPartition\tpPeg_GclDm.pas' {tpPeg_GclData: TDataModule},
  tpPeg_GclFme in '..\..\TenderPartition\tpPeg_GclFme.pas' {tpPeg_GclFrame: TFrame},
  tpPegBlock in '..\..\TenderPartition\tpPegBlock.pas',
  tpPegGclGatherDm in '..\..\TenderPartition\tpPegGclGatherDm.pas' {tpPegGclGatherData: TDataModule},
  tpPegGclGatherFme in '..\..\TenderPartition\tpPegGclGatherFme.pas' {tpPegGclGatherFrame: TFrame},
  tpPegPartSettingFrm in '..\..\TenderPartition\tpPegPartSettingFrm.pas' {tpPegPartSettingForm},
  tpPricePartSettingFrm in '..\..\TenderPartition\tpPricePartSettingFrm.pas' {tpPricePartSettingForm},
  tpSelectTenderDm in '..\..\TenderPartition\tpSelectTenderDm.pas' {tpSelectTenderData: TDataModule},
  tpSelectTenderNode in '..\..\TenderPartition\tpSelectTenderNode.pas',
  tpSelectTendersFrm in '..\..\TenderPartition\tpSelectTendersFrm.pas' {SelectTendersForm},
  tpTrialPegInputFrm in '..\..\TenderPartition\tpTrialPegInputFrm.pas' {TrialPegInputForm},
  mPegFilter in '..\..\Units\mPegFilter.pas',
  MScrollBox in '..\..\..\SmartCost\Components\MBaseControl\Source\MScrollBox.pas',
  ClientService in '..\..\Encrypt\NetClient\ClientService.pas',
  CfgPort in '..\..\Encrypt\NetClient\CfgPort.pas',
  CorrespondClient in '..\..\Encrypt\NetClient\CorrespondClient.pas',
  EnctyptClientData in '..\..\Encrypt\NetClient\EnctyptClientData.pas',
  ColVisibleManager in '..\..\Units\ColVisibleManager.pas',
  ReportPrepare in '..\..\Report\ReportPrepare.pas',
  rdpBillsGatherDm in '..\..\Report\DataPrepare\rdpBillsGatherDm.pas' {rdpBillsGatherData: TDataModule},
  rdpTables in '..\..\Report\DataPrepare\rdpTables.pas',
  ReportConnection in '..\..\Report\ReportConnection.pas',
  rgpGatherControl in '..\..\Report\ProjGather\rgpGatherControl.pas',
  rpgBillsCalcDm in '..\..\Report\ProjGather\rpgBillsCalcDm.pas' {rpgBillsCalcData: TDataModule},
  rpgBillsDm in '..\..\Report\ProjGather\rpgBillsDm.pas' {rpgBillsData: TDataModule},
  rpgGatherControl in '..\..\Report\ProjGather\rpgGatherControl.pas',
  rpgGatherData in '..\..\Report\ProjGather\rpgGatherData.pas',
  rpgGatherProjDm in '..\..\Report\ProjGather\rpgGatherProjDm.pas' {rpgGatherProjData: TDataModule},
  rProjGatherTables in '..\..\Report\ProjGather\rProjGatherTables.pas',
  ProjGather in '..\..\ProjGather\ProjGather.pas',
  GatherProjInfo in '..\..\ProjGather\GatherProjInfo.pas',
  ProjGatherCalcData in '..\..\ProjGather\ProjGatherCalcData.pas',
  ProjGatherSelectFrm in '..\..\ProjGather\ProjGatherSelectFrm.pas' {ProjGatherSelectForm},
  ProjGatherTree in '..\..\ProjGather\ProjGatherTree.pas',
  CalcData in '..\..\Units\CalcData.pas',
  DealBillsExcelImport in '..\..\Units\DealBillsExcelImport.pas',
  ExcelImport_Bills in '..\..\Units\ExcelImport_Bills.pas',
  ExcelImport_GclBills in '..\..\Units\ExcelImport_GclBills.pas',
  UpFileSelectOnLineFrm in '..\..\Forms\UpFileSelectOnLineFrm.pas' {UpFileSelectOnLineForm},
  FileDownLoadFrm in '..\..\Forms\FileDownLoadFrm.pas' {FileDownLoadForm},
  DebugUsers in '..\..\Units\DebugUsers.pas',
  ScReportHelperUnit in '..\..\..\SmartCost\Reports\UI\ScReportHelperUnit.pas',
  DbTreeImport in '..\..\Units\DbTreeImport.pas',
  DbTreeDm in '..\..\DataModules\DbTreeDm.pas',
  OtherMeasurePhaseDm in '..\..\DataModules\OtherMeasurePhaseDm.pas' {OtherMeasurePhaseData: TDataModule},
  OtherMeasureOnceDm in '..\..\DataModules\OtherMeasureOnceDm.pas' {OtherMeasureOnceData: TDataModule},
  OMPhaseRecord in '..\..\Units\DataRecord\OMPhaseRecord.pas',
  OtherMeasureFme in '..\..\Frames\OtherMeasureFme.pas' {OtherMeasureFrame: TFrame},
  ProjGatherSelectFme in '..\..\ProjGather\ProjGatherSelectFme.pas' {ProjGatherSelectFrame: TFrame},
  rpgZoneGatherControl in '..\..\Report\ProjGather\Zone\rpgZoneGatherControl.pas',
  rpgZoneProjGatherSelectFrm in '..\..\Report\ProjGather\Zone\rpgZoneProjGatherSelectFrm.pas' {rpgZoneProjGatherSelectForm},
  SetGuestFrm in '..\..\Forms\SetGuestFrm.pas' {SetGuestForm},
  LogUtils in '..\..\Units\LogUtils.pas',
  ReportPdfHelper in '..\..\Units\ReportPdfHelper.pas',
  SelectOnlineSignPhaseFrm in '..\..\Forms\SelectOnlineSignPhaseFrm.pas' {SelectOnlineSignPhaseForm},
  SignOnlineReportsFrm in '..\..\Forms\SignOnlineReportsFrm.pas' {SignOnlineReportsForm},
  SignReports in '..\..\Units\SignReports.pas',
  TemplateManagerHelper in '..\..\Units\TemplateManagerHelper.pas',
  RenameSignReportFrm in '..\..\Forms\RenameSignReportFrm.pas' {RenameSignReportForm},
  rmWeiWuZjjlGatherDm in '..\..\DataModules\ReportMemoryDm\rmWeiWuZjjlGatherDm.pas' {rmWeiWuZjjlGatherData: TDataModule},
  ReportHistoryFrm in '..\..\Forms\ReportHistoryFrm.pas' {ReportHistoryForm},
  ReportManagerFrm in '..\..\Forms\ReportManagerFrm.pas' {ReportManagerForm},
  ReportManagerDM in '..\..\DataModules\ReportManagerDM.pas' {Reports: TDataModule},
  ProjGatherDealPay in '..\..\ProjGather\ProjGatherDealPay.pas',
  ProjGatherProperties in '..\..\ProjGather\ProjGatherProperties.pas',
  rpgDealPayDm in '..\..\Report\ProjGather\rpgDealPayDm.pas' {rgpDealPayData: TDataModule},
  superobject in '..\..\Units\superobject\superobject.pas',
  superxmlparser in '..\..\Units\superobject\superxmlparser.pas';

{$R *.res}

var
  Mutex: THandle;
  IPForm: TIPForm;
  vFDForm: TFileDownLoadForm;
  sInfo, sURL, sName: string;

begin
  Mutex := CreateMutex(nil, True, G_AppHandleName);

  if GetLastError = ERROR_ALREADY_EXISTS then
    Application.MessageBox('程序正在运行, 请勿重复打开该软件！', '系统提示', MB_OK + MB_ICONINFORMATION)
  else
  begin
    Application.CreateHandle;
    Application.Initialize;
    Application.Title := '纵横公路工程结算决算计量一体化软件云版';
    {$IFDEF _mCloud}
      IPForm := TIPForm.Create(nil);
      try
        if not IPForm.HasIP then
        begin
          IPForm.ShowModal;
          if IPForm.ModalResult <> mrOK then
          begin
            Application.Terminate;
            Exit;
          end;
        end;
      finally
        IPForm.Free;
      end;

      {$IFDEF _mLoginNoPW}
      sName := PHPWeb.GetNameFromURLProtocol(ParamStr(1));

      if sName = '' then         // 表示手工运行的
      begin
        Application.MessageBox('请从 项目管理信息平台 打开软件。', '系统提示', MB_OK + MB_ICONINFORMATION);
        Application.Terminate;
      end
      else
      begin
        // For Test only!
//        Application.MessageBox(PChar(ParamStr(1) + #10#13 + sName), '系统提示', MB_OK + MB_ICONINFORMATION);
//        Application.Terminate;
        if sName[1] = '%' then
          sName := UTF8Decode(HttpDecode(sName));

        case PHPWeb.Login(sName, '', 2, sInfo, sURL) of
          ltLoginFail:
          begin
            Application.MessageBox('该用户尚未注册不能登录！', '操作提醒', MB_OK + MB_ICONWARNING);
            Application.Terminate;
          end;

          ltUpdate:  // 升级
          begin
            if Application.MessageBox(PChar(sInfo), '系统提示', MB_OKCANCEL + MB_ICONQUESTION) = ID_OK then
            begin
              vFDForm := TFileDownLoadForm.Create(nil);
              try
                vFDForm.URL := sURL;
                vFDForm.ShowModal;
              finally
                vFDForm.Free;
              end;
            end;
            Application.Terminate;
          end;

          ltDisCon:
          begin
            Application.MessageBox('网络错误，请稍后重试！', '操作提醒', MB_OK + MB_ICONWARNING);
            Application.Terminate;
          end;

        else
          ;
        end;  
      end;

      {$ELSE}
      if not LoginForm then
      begin
        Application.Terminate;
        Exit;
      end;
      {$ENDIF}
      
    {$ENDIF}

    if CheckDogExists then
    begin
      Application.CreateForm(TMainForm, MainForm);
  Application.CreateForm(TSetGuestForm, SetGuestForm);
  end;
    Application.Run;
  end;

  ReleaseMutex(Mutex);
end.
