Flash Belleginiz Bilgisayarınızın Anahtarı Olsun
Flash Belleginizi Bilgisayarınızın anahtarı olsun ve Flashınızı cıkardıgınız zaman bilgisayarınız kapansın.Bir nevi kucuk bir guvenlık onlemı diyelim. Veya meraklısına
Kodlari =
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace PCKontrol
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}
public bool DonanimBul()
{
DriveInfo[] Drives = DriveInfo.GetDrives();
foreach (DriveInfo Drive in Drives)
{
if (Drive.DriveType == DriveType.Removable && Drive.IsReady)
{
if (Drive.VolumeLabel.Contains(textBox1.Text))
{
return true;
}
}
}
return false;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Interval = 3000;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
bool durum=DonanimBul();
if (!durum)
{
System.Diagnostics.Process.Start("shutdown"," -s -t 00 -f");
}
}
}
}
Programın exe si :
http://hotfile.com/dl/146117908/4d08466/PCKontrol.rar.html
Kodlari =
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace PCKontrol
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
}
public bool DonanimBul()
{
DriveInfo[] Drives = DriveInfo.GetDrives();
foreach (DriveInfo Drive in Drives)
{
if (Drive.DriveType == DriveType.Removable && Drive.IsReady)
{
if (Drive.VolumeLabel.Contains(textBox1.Text))
{
return true;
}
}
}
return false;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
timer1.Interval = 3000;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
bool durum=DonanimBul();
if (!durum)
{
System.Diagnostics.Process.Start("shutdown"," -s -t 00 -f");
}
}
}
}
Programın exe si :
http://hotfile.com/dl/146117908/4d08466/PCKontrol.rar.html
Yorumlar
Yorum Gönder