VirtualUI allows you to send external arguments in the url. Instead of passing static arguments from the application profile definition, using this feature you can send dynamic application arguments in a simple way. The only requirement to be met is that the arguments must be url encoded.
To build the url you need:
· The communication protocol (http or https).
· The Thinfinity VirtualUI server domain or IP address, and port.
· The application virtual path.
Build the url like this:
protocol://server.address:port/virtualpath/?arguments
As an example, we will send the "one", "two" and "three" argument values to the TestArguments program:
http://192.168.0.229:6580/TestArguments/?one%20two%20three
The following image shows the submit result:
Read more:
· Setting Command Line Arguments in the Application Profile
· Building the URL in Javascript
· Combining Application Profile and URL Command Line Arguments
bt - current position
Thinfinity VirtualUI enables external argument definition from the VirtualUI Server Manager. When you create an application profile, you can specify the execution arguments in the General tab panel of the Application Profiles editor.
These arguments will be received by the application as a list of string values, using the white-space character as argument delimiter.
In Delphi you can get command line arguments using the System.ParamCount and System.ParamStr methods. ParamCount returns the number of arguments, and ParamStr(index) returns each argument, with ParamStr(0) always being the path and name of the invoked program. Here is a way you can show the received arguments list:
In C++, both the argument counter and the argument list will be received in the two main() function arguments. Like in Delphi, the first argument in the string array is the path and name of the program itself:
You can also write the main function header in this way:
Unlike Delphi and C++, C# excludes the name and path of the program from the arguments collection. Also, C# offers two ways to get the arguments, by using a traditional for:
or by using the foreach:
Read more:
· Sending Command Line Arguments in the VirtualUI URL
· Building the URL in Javascript
· Combining Application Profile and URL Command Line Arguments
When necessary, modern browsers encode URLs automatically, but it is convenient to do it by code. The Javascript lines below show how to build the URL used in the previous example:
var buildURL = function(server, virtualpath, arguments) {
return server + "/" + virtualpath + "/" + encodeURIComponent(arguments.join(' '));
}
var baseURL = "http://192.168.0.229:6580/";
var applicationPath = "TestArguments";
var arguments = ["one", "two", "three"];
var url = buildURL(baseURL, applicationPath, arguments);
Read more:
· Setting Command Line Arguments in the Application Profile
· Sending Command Line Arguments in the VirtualUI URL
· Combining Application Profile and URL Command Line Arguments
If you have defined command line arguments in the application profile and need to send new arguments to the application by url, don't worry. Thinfinity VirtualUI merges both argument lists, first adding the application profile arguments, and then the arguments that were passed in the url.
Read more:
· Setting Command Line Arguments in the Application Profile
An application can accept command line arguments when invoked. This allows the user to send additional information to the application when it is executed.
When an application is launched, the OS passes the command line arguments to the application as a collection of string values, using a white-space as separator.
Applications receive external arguments on a regular basis: when you open a document by clicking on its icon, the OS selects the associated executable program and calls it, sending the full document filename to the program as an argument.
Thinfinity VirtualUI allows you to send external arguments to applications in a transparent way, which works exactly like sending arguments from the command line.
Read more:
· Setting Command Line Arguments in the Application Profile
· Sending Command Line Arguments in the VirtualUI URL
· Building the URL in Javascript
· Combining Application Profile and URL Command Line Arguments