Share this page

# ctrx_set_connect_opt

Example | Connection Functions

Sets a connection option to a Citrix ICA server and then connects to server.

Note: Supported only for legacy single-protocol Citrix scripts.

`int ctrx_set_connect_opt( eConnectionOption option, char *value);`

option | eConnectionOption
value | The option's value

ctrx_set_connect_opt sets a connection option prior to establishing a connection from a Citrix client to a Citrix server, and then executes the connection to the server.

Pass one of the following as the option argument:

- APPLICATION - Use this to launch an application automatically upon login to the Citrix server. ctrx_set_connect_opt is automatically generated with this option when the "Published Application" field in the "Login Info" Recording Options is set.
- NETWORK_PROTOCOL - Use this option to change to the TCP/IP+HTTP protocol when using NFUSE. ctrx_set_connect_opt is automatically generated with this option when the "Network Protocol" field in the Connection Recording Options is set.
- ICAFILE - Use this to indicate the path to the ICA initialization file. ctrx_set_connect_opt is automatically generated with this option when the "File" field in the "Use ICA file for login" Recording Options is set.
- CLIENT_NAME - Use this option to indicate a Citrix client name. If you do not indicate a specific name, VuGen creates a default name during recording: server username VuserID (VuserID only in Controller).

## Return Values

Citrix ICA Return Values

## Parameterization

The parameter value can be parameterized.

## Example

In the following example, the function ctrx_set_connect_opt is invoked to start the Microsoft Windows Calculator application immediately after login to the server ludens. A further call to ctrx_set_connect_opt with the ICAFILE option directs VuGen to the script to the ICA initialization file.

    Action() {

         ctrx_set_connect_opt(APPLICATION, "#calc");
         ctrx_set_connect_opt(ICAFILE, "c:\\temp\\word.ica");
         ctrx_connect_server("ludens", "test10", "test", "ludens", CTRX_LAST);
         lr_think_time(8);

         ctrx_wait_for_event("LOGON");
         ctrx_set_window("Calculator", CTRX_LAST);

         ctrx_mouse_click(247, 9, LEFT_BUTTON, 0, "Calculator", CTRX_LAST);
         ctrx_unset_window("Calculator", CTRX_LAST);
         lr_think_time(2);

         ctrx_disconnect_server("ludens", CTRX_LAST);

         return 0;
    }

Tips to improve your search results... VuGen Function Reference Version 25.1-25.3 Function Reference 25.1-25.3 All View Local Help Center View Online Help Center Version: