Jump to content

http://Localhost:8077 (with lines of Delphi code)


SergioFeitoza

Recommended Posts

When I have my code opened in Delphi + Unigui  and I do F9 to run it I need just after entering the browser and typing http://localhost: 8077 to see the screen in the browser. What is the way to do this automatically with a Delphi line of code?  If this possible to do where is the point to include the code ?

Link to comment
Share on other sites

Hi,

see code below for ServerModule to start browser automatically while debugging:

 

  private

  protected
    procedure FirstInit; override;

implementation

procedure ExploreWeb(page:PChar);

begin
  ShellExecute(0, 'open', page, nil, nil, 1);
end;

procedure TUniServerModule.UniGUIServerModuleBeforeInit(Sender: TObject);

begin
  if ExtractFileExt(ExtractFileName(ParamStr(0)))='.exe'
  then ExploreWeb(pchar('http://localhost:'+ IntToStr(port)));
end;

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...