ParseUrl Example

InstallShield 2024 » InstallScript Language Reference

/*--------------------------------------------------------------*\

*

* InstallShield Example Script

*

* Demonstrates the ParseUrl function.

*

\*--------------------------------------------------------------*/

 

function OnBegin()

    ISURL_COMPONENTS ISUrlComponents;

    STRING szUrl;

begin

    szUrl =

        "http://myusername:mypassword@www.mydomain.com:8080/" +

        "myfolder/mypage.asp?mykey=myvalue";

    ParseUrl ( szUrl, &ISUrlComponents );

    SprintfBox ( INFORMATION , "ParseUrl" ,

        "scheme = %s\nscheme number = %ld\nusername = %s\npassword = %s" +

        "\nhostname = %s\nport = %ld\nurlpath = %s\nextrainfo = %s",

        ISUrlComponents.szScheme, ISUrlComponents.nInternetScheme,  

        /* nInternetScheme equals 3 for HTTP and 4 for HTTPS. */

        ISUrlComponents.szUserName, ISUrlComponents.szPassword,

        ISUrlComponents.szHostName, ISUrlComponents.nInternetPort,

        ISUrlComponents.szUrlPath, ISUrlComponents.szExtraInfo );

    abort;

end;

That script produces the following output:

ParseUrl Output