using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Diagnostics;
namespace MovSysSht
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
try
{
RegistryKey rk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\PerfProc\Performance", true);
if (rk != null)
{
object tmpObj = rk.GetValue("Disable Performance Counters");
if (tmpObj != null && !tmpObj.Equals(0))
{
rk.SetValue("Disable Performance Counters", 0);
//要添加一个日志表明此处删除了一个注册表值
}
}
Process[] pros = Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName);
if (pros.Length > 1)
{
Application.Exit();
return;
}
Application.Run(new SHTMain());
}
catch (Exception ex) { }
}
}
}