QWS3270 COM .NET Help |
Application..::.StartSession Method |
Application Class Example See Also Send Feedback |
Starts the specified program and attempts to open a connection to the specified session. The session must have been previously created in the corresponding program, and a HLLAPI session ID must have been set for that session.
Namespace: JollyGiant.Emulation
Assembly: JGSComdotNet (in JGSComdotNet.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C# |
---|
public StatusCode StartSession( string qwsPath, string sessionName ) |
Visual Basic (Declaration) |
---|
Public Function StartSession ( _ qwsPath As String, _ sessionName As String _ ) As StatusCode |
Visual C++ |
---|
public: virtual StatusCode StartSession( String^ qwsPath, String^ sessionName ) sealed |
JavaScript |
---|
function StartSession(qwsPath, sessionName); |
Parameters
qwsPath
Type: System..::.StringFull String
Full name and path of the QWS program executable, for example "C:\Program Files\QWS3270 PLUS\qws3270p.exe"
sessionName
Type: System..::.StringThe String
The name of the session to connect to.
Return Value
The StatusCode indicating the result of the operation.This can be one of the following values:
Status code | Description |
---|---|
Ok | The new process was successfully started with the specified session. Note that this does not guarantee that the session exists, or that the connection to the remote host was made. |
WHLLSTARTPROCFAILED | The process could not be started. |
WHLLUNKNOWN | An unknown error occurred. |
Implements
IApplication..::.StartSession(String, String)Examples
Starts a new QWS3270 PLUS instance and tries to connect to "WorkSession".
CopyC#
void reportError(JollyGiant.Emulation.StatusCode code) { Console.WriteLine(JollyGiant.Emulation.Utility.errorToString(code)); } QWS3270 qws = new QWS3270(); string path = @"C:\Program Files\QWS3270 PLUS\qws3270p.exe"; string session = "WorkSession"; JollyGiant.Emulation.StatusCode code = qws.Application.StartSession(path, session); if (code == StatusCode.Ok) reportError(code);
Exceptions
Exception | Condition |
---|---|
System..::.ArgumentException | One of the supplied arguments was null or an empty string. |
System.IO..::.FileNotFoundException | The path to the executable passed to the method was invalid. |