Создание программы Tweaker

Дипломная работа - Компьютеры, программирование

Другие дипломы по предмету Компьютеры, программирование



/p>

private void button4_MouseLeave(object sender, EventArgs e)

{ toolStripStatusLabel1.Text = ""; }

private void button5_MouseHover(object sender, EventArgs e)

{ toolStripStatusLabel1.Text = "Recycle"; }

private void button5_MouseLeave(object sender, EventArgs e)

{ toolStripStatusLabel1.Text = ""; }

private void button6_Click(object sender, EventArgs e)

{

if (checkBox1.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoControlPanel", 1);}

else

{if (checkBox1.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoControlPanel", 0);}}

if (checkBox6.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoSetTaskbar", 1);

}

else

{if (checkBox6.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoSetTaskbar", 0);}}

if (checkBox2.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);

key.SetValue("NoDispCPL", 1);}

else

{if (checkBox2.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);

key.SetValue("NoDispCPL", 0);}}

if (checkBox3.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Network", true);

key.SetValue("NoNetSetup", 1);

}

else

{if (checkBox3.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Network", true);

key.SetValue("NoNetSetup", 0);}}

if (checkBox7.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall", true);

key.SetValue("NoRemovePage", 1);

}

else

{if (checkBox7.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall", true);

key.SetValue("NoRemovePage", 0);}}

if (checkBox8.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoClose", 1);

}

else

{if (checkBox8.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoClose", 0);}}

if (checkBox9.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoRun", 1);

}

else

{if (checkBox9.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("NoRun", 0);}}

if (checkBox10.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("DisableRegistryTools", 1);

}

else

{if (checkBox10.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer", true);

key.SetValue("DisableRegistryTools", 0);}}

if (checkBox11.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall", true);

key.SetValue("NoAddFromInternet", 1);

}

else

{if (checkBox11.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Uninstall", true);

key.SetValue("NoAddFromInternet", 0);}}

if (checkBox12.Checked == true)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);

key.SetValue("NoDispSettingsPage", 1);

}

else

{if (checkBox12.Checked == false)

{RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System", true);

key.SetValue("NoDispSettingsPage", 0);}}

}

private void Form1_Load(object sender, EventArgs e)

{

label1.Text = ("Computer Name: " + Environment.MachineName);

label2.Text = ("User Name: " + Environment.UserName);

label3.Text = ("Platform: " + Environment.OSVersion);

label4.Text = ("Identity: " + Environment.OSVersion.Platform);

label5.Text = ("Time From System Load: " + Environment.TickCount);

label6.Text = ("Physical Memory:" + Environment.WorkingSet / 1024);

label7.Text = ("CPU Count: " + Environment.ProcessorCount);

label8.Text = ("Command line: " + Environment.CommandLine);

{ try

{

ManagementObjectSearcher searcher=new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_VideoController");

foreach (ManagementObject queryObj in searcher.Get())

{

int i;

VideocardName.Text=(""+ queryObj["Caption"]);

MemoryType.Text=("GDDR"+ queryObj["VideoArchitecture"]);

if(queryObj["AcceleratorCapabilities"] == null)

AcceleratorCapabilities.Text=(""+ queryObj["AcceleratorCapabilities"]);

else

{UInt16[] arrAcceleratorCapabilities = (UInt16[])(queryObj["AcceleratorCapabilities"]);

foreach (UInt16 arrValue in arrAcceleratorCapabilities)

{AcceleratorCapabilities.Text=(""+ arrValue);}}

AdapterCompability.Text=(""+ queryObj["AdapterCompatibility"]);

Memory.Text=(""+queryObj["AdapterRAM"]);

string s=Memory.Text;

i=Int32.Parse(s);

double z = i/1048576;

Memory.Text=z.ToString()+"Mb";

ClassName.Text=(""+ queryObj["CreationClassName"]);

BitPerPixel.Text=(""+ queryObj["CurrentBitsPerPixel"]);BitPerPixel.Text=(""+ queryObj["CurrentBitsPerPixel"]);

ResolutionWidth.Text=(""+ queryObj["CurrentHorizontalResolution"]);

Colors.Text=(""+ queryObj["CurrentNumberOfColors"]);

RefreshRate.Text=(""+ queryObj["CurrentRefreshRate"]+"MHz");

ResolutionHeight.Text=(""+ queryObj["CurrentVerticalResolution"]);

DeviceID.Text=(""+ queryObj["DeviceID"]);

DriverVersion.Text=(""+ queryObj["DriverVersion"]);

DisplayDrivers.Text=(""+ queryObj["InstalledDisplayDrivers"]);

MinRefreshRate.Text=(""+ queryObj["MinRefreshRate"]+"MHz");

PNPDeviceID.Text=(""+ queryObj["PNPDe