Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions CenterView/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -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
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
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
{
/// <summary>
/// App.xaml 的交互逻辑
/// </summary>
public partial class App : Application
{
}
}
3 changes: 3 additions & 0 deletions CenterView/CenterView.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
<ItemGroup>
<Reference Include="PresentationFramework.Aero" />
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
Expand Down Expand Up @@ -71,6 +73,7 @@
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="CkCitrix.cs" />
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
Expand Down
57 changes: 57 additions & 0 deletions CenterView/CkCitrix.cs
Original file line number Diff line number Diff line change
@@ -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<string> subkeyNames = new List<string>();
//当前用户
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;
}
}
}

590 changes: 295 additions & 295 deletions CenterView/MainWindow.xaml

Large diffs are not rendered by default.

177 changes: 112 additions & 65 deletions CenterView/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,65 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace CenterView
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}

private void menu_Click(object sender, RoutedEventArgs e)
{
menu1.IsOpen = true;
}

private void x_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
// 下载于www.mycodes.net
private void ___Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}

private void ksl_Click(object sender, RoutedEventArgs e)
{
//if (list1.Items.Count > 2)
//{
// return;
//}
//list1.Items.Add("扫描c盘中...");
//list1.Items.Add("扫描d盘中...");
//list1.Items.Add("扫描e盘中...");
//list1.Items.Add("扫描d盘中...");
//list1.Items.Add("扫描g盘中...");
//list1.Items.Add("扫描l盘中...");
//list1.Items.Add("扫描i盘中...");
//list1.Items.Add("扫描j盘中...");
//list1.Items.Add("扫描k盘中...");
//list1.Items.Add("扫描完毕");
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;
using Microsoft.Win32;
using System.Windows.Forms;
using System.Diagnostics;
using System.IO;

namespace CenterView
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}

private void menu_Click(object sender, RoutedEventArgs e)
{
menu1.IsOpen = true;
}

private void x_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
// 下载于www.mycodes.net
private void ___Click(object sender, RoutedEventArgs e)
{
this.WindowState = WindowState.Minimized;
}

private void ksl_Click(object sender, RoutedEventArgs e)
{
//if (list1.Items.Count > 2)
//{
// return;
//}
//list1.Items.Add("扫描c盘中...");
//list1.Items.Add("扫描d盘中...");
//list1.Items.Add("扫描e盘中...");
//list1.Items.Add("扫描d盘中...");
//list1.Items.Add("扫描g盘中...");
//list1.Items.Add("扫描l盘中...");
//list1.Items.Add("扫描i盘中...");
//list1.Items.Add("扫描j盘中...");
//list1.Items.Add("扫描k盘中...");
//list1.Items.Add("扫描完毕");
}


private void window_Loaded(object sender, RoutedEventArgs e)
{
//显示citrix插件是否安装
{
var isExistCkCitrix = CkCitrix.CheckCitrix();
if (isExistCkCitrix)
{
citrix1.Text = "Ctrix Receiver已安装";
//判断citrix是否运行
var isWorkCitrix = CkCitrix.IsProcessStarted();
if (isWorkCitrix)
{
citrix2.Text = "Citrix Receiver正在运行";
}
else
{
citrix2.Text = "为您启动Citrix Receiver";
try
{
System.Diagnostics.Process.Start("C:\\Program Files (x86)\\Citrix\\ICA Client\\wfcrun32.exe");//启动cx,软件安装位置用户无法选择
}
catch
{
citrix2.Text = "Citrix Receiver启动失败";
}
}
}
else
{
citrix1.Text = "Citrix Receiver未安装";
citrix2.Text = "Citrix Receiver未启动";
}
}
}
}
}






110 changes: 55 additions & 55 deletions CenterView/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CenterView")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("CenterView")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
//若要开始生成可本地化的应用程序,请在
//<PropertyGroup> 中的 .csproj 文件中
//设置 <UICulture>CultureYouAreCodingWith</UICulture>。 例如,如果您在源文件中
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(在页面或应用程序资源词典中
// 未找到某个资源的情况下使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(在页面、应用程序或任何主题特定资源词典中
// 未找到某个资源的情况下使用)
)]
// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// 有关程序集的常规信息通过以下
// 特性集控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("CenterView")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP Inc.")]
[assembly: AssemblyProduct("CenterView")]
[assembly: AssemblyCopyright("Copyright © HP Inc. 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// 将 ComVisible 设置为 false 使此程序集中的类型
// 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
// 则将该类型上的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]

//若要开始生成可本地化的应用程序,请在
//<PropertyGroup> 中的 .csproj 文件中
//设置 <UICulture>CultureYouAreCodingWith</UICulture>。 例如,如果您在源文件中
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
//对以下 NeutralResourceLanguage 特性的注释。 更新
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
//(在页面或应用程序资源词典中
// 未找到某个资源的情况下使用)
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
//(在页面、应用程序或任何主题特定资源词典中
// 未找到某个资源的情况下使用)
)]


// 程序集的版本信息由下面四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
// 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
// 方法是按如下所示使用“*”:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Loading