Detect termination of Citrix session launched by kiosk application

前端 未结 1 972
天命终不由人
天命终不由人 2021-01-15 18:07

I am working on a kiosk application which gives the user a selection of Citrix connections.

The idea is that the user selects a connection presented by the kiosk app

相关标签:
1条回答
  • 2021-01-15 18:38

    In a C# Application you can reference WFICALib.dll (in your Citrix Ica Client folder), create an ICAClientClass object, subscribe to the and call it's Disconnect event, and call the LoadIcaFile method to launch your connection.

    In your handler for the Disconnect method you would need to add code to initiate the log-off and terminate the current application.

    An example implementation:

    public static void Connect()
    {
        // Configure the connection.
        ICAClientClass ica = new ICAClientClass();
        ica.Application = string.Empty;
        ica.InitialProgram = "#Name of Citrix application to launch";
        ica.Launch = true;
        ica.Domain = Environment.UserDomainName;
        ica.DesiredColor = ICAColorDepth.Color24Bit;
        ica.OutputMode = OutputMode.OutputModeNormal;
        ica.MaximizeWindow();
        ica.ClientAudio = true;
        ica.AudioBandwidthLimit = ICASoundQuality.SoundQualityMedium;
        ica.Compress = true;
        ica.ScreenPercent = 100;
        ica.TransportDriver = "TCP/IP";
        ica.WinstationDriver = "ICA 3.0";
        ica.SSLEnable = false;
        ica.SSLCiphers = "ALL";
        ica.SSLProxyHost = "*:443";
        ica.EncryptionLevelSession = "EncRC5-128";
    
        // Citrix server name or IP
        ica.Address = "x.x.x.x"; 
    
        // Setup handler for disconnect event.
        ica.OnDisconnect += ica_OnDisconnect;
    
        // Initiate the connection.
        ica.Connect();
    }
    
    private static void ica_OnDisconnect()
    {
        Console.WriteLine("ica_OnDisconnect");
    }
    
    0 讨论(0)
提交回复
热议问题