检测Citrix会话终止由KIOSK应用程序启动 [英] Detect termination of Citrix session launched by kiosk application

查看:335
本文介绍了检测Citrix会话终止由KIOSK应用程序启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个小亭的应用程序,为用户提供了一个选择的Citrix连接。

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

我们的想法是,用户选择由KIOSK应用程序提出了一个连接,然后亭发射器启动运行类似以下的命令所选择的连接:

The idea is that the user selects a connection presented by the kiosk application, and then the kiosk launcher initiates the selected connection by running a command similar to this:

C:\Program Files\Citrix\ICA Client\wfica32.exe \\server\path\to\icaFile.ica

我希望用户留在Citrix会话中 - 没有任何安全理由,只是为了一个良好的用户体验获得到选定的会话,并最终注销。所以我推出一个全屏幕会话,直到用户注销一切都很好。

I want the user to stay within the Citrix session - not for any security reason, just to make it a good user experience getting to the selected session and eventually logging off. So I launch a full-screen session and everything is fine until the user logs off.

当用户注销Citrix会话,我想也启动注销客户端计算机。我试着用类似于下面的代码明显的方式这样做的:

When the user logs off the Citrix session, I want to also initiate a logoff on the client computer. I've tried doing this in the obvious way by using code similar to the following:

Process citrixProcess = new Process();
citrixProcess.StartInfo = new ProcessStartInfo();
citrixProcess.StartInfo.FileName = "C:\Program Files\Citrix\ICA Client\wfica32.exe";
citrixProcess.StartInfo.Arguments = "\\server\path\to\icaFile.ica";
citrixProcess.Start();
citrixProcess.WaitForExit();
//
// Followed by code to initiate logoff from the local computer
//


发起注销

,但不是在等待过程对象代码继续沿着正确的下一部分启动注销。其结果是,由于在本地计算机注销立即发生的Citrix会话几乎立即终止。我最好的猜测是,最初推出的wfica32.exe推出一个新的进程实际处理会议后立即退出。但如果这是正在发生的事情不是很明显该怎么办它,因为wfica32.exe似乎仍然在运行,一旦Citrix会话启动。

But instead of waiting on the Process object the code continues right along to the next section which initiates the logoff. The result is that the Citrix session is terminated almost immediately because a local computer logoff happens immediately. My best guess is that the initial launch of wfica32.exe is exiting immediately after launching a new process to actually handle the session. But if this is what is happening it is not obvious what to do about it since wfica32.exe still appears to be running once the Citrix session is launched.

我要找一个可靠的方法来检测时,Citrix会话发起这种方式已经终止。

I am looking for a reliable way to detect when a Citrix session launched this way has terminated.

推荐答案

在你可以参考WFICALib C#应用程序。 DLL(在Citrix ICA客户端文件夹),创建一个ICAClientClass对象,订阅并调用它断开事件,并调用LoadIcaFile方法来启动你的连接。

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.

在。您的Disconnect方法处理程序,你需要将代码添加到启动注销并终止当前应用程序

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

这是示例实现:

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");
}

这篇关于检测Citrix会话终止由KIOSK应用程序启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆