diff --git a/CenterView/App.xaml.cs b/CenterView/App.xaml.cs index f1f6ae1..040be65 100644 --- a/CenterView/App.xaml.cs +++ b/CenterView/App.xaml.cs @@ -1,17 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Data; -using System.Linq; -using System.Threading.Tasks; -using System.Windows; - -namespace CenterView -{ - /// - /// App.xaml 的交互逻辑 - /// - public partial class App : Application - { - } -} +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace CenterView +{ + /// + /// App.xaml 的交互逻辑 + /// + public partial class App : Application + { + } +} diff --git a/CenterView/CenterView.csproj b/CenterView/CenterView.csproj index 5314fc6..dd05faa 100644 --- a/CenterView/CenterView.csproj +++ b/CenterView/CenterView.csproj @@ -37,7 +37,9 @@ + + @@ -71,6 +73,7 @@ App.xaml Code + MainWindow.xaml Code diff --git a/CenterView/CkCitrix.cs b/CenterView/CkCitrix.cs new file mode 100644 index 0000000..297e855 --- /dev/null +++ b/CenterView/CkCitrix.cs @@ -0,0 +1,57 @@ +using Microsoft.Win32; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.ComponentModel; +using System.Diagnostics; + +namespace CenterView +{ + public class CkCitrix + { + //检测citrix是否存在 + public static bool CheckCitrix() + { + List subkeyNames = new List(); + //当前用户 + RegistryKey CurrentUserhkml = Registry.CurrentUser; + RegistryKey CurrentUsersoftware = CurrentUserhkml.OpenSubKey("SOFTWARE"); + subkeyNames = CurrentUsersoftware.GetSubKeyNames().ToList(); + if (subkeyNames.Contains("Citrix")) + { + CurrentUserhkml.Close(); + return true; + } + else + { + CurrentUserhkml.Close(); + } + //本机安装 + RegistryKey LocalMachinehkml = Registry.LocalMachine; + RegistryKey LocalMachinesoftware = LocalMachinehkml.OpenSubKey("SOFTWARE"); + subkeyNames = LocalMachinesoftware.GetSubKeyNames().ToList(); + if (subkeyNames.Contains("Citrix")) + { + LocalMachinehkml.Close(); + return true; + } + else + { + + LocalMachinehkml.Close(); + return false; + } + } + + //检查cx是否在运行 + public static bool IsProcessStarted() + { + Process[] temp = Process.GetProcessesByName("wfcrun32"); + if (temp.Length > 0) return true; + else + return false; + } + } + } + diff --git a/CenterView/MainWindow.xaml b/CenterView/MainWindow.xaml index bbeeafd..232bd96 100644 --- a/CenterView/MainWindow.xaml +++ b/CenterView/MainWindow.xaml @@ -1,295 +1,295 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -