コード例 #1
0
ファイル: Worker.cs プロジェクト: PoH98/MyBot.Supporter
 private void InTime(BotSetting botSetting)
 {
     if (botSetting.Id.HasValue)
     {
         return;
     }
     if (ProcessName.EndsWith(".exe"))
     {
         ProcessStartInfo start = new ProcessStartInfo(ProcessName)
         {
             Arguments              = botSetting.ProfileName + " " + botSetting.Emulator + " " + botSetting.Instance + " " + "-a" + " " + "-nwd" + " " + "-nbs",
             RedirectStandardError  = false,
             RedirectStandardOutput = false,
             WindowStyle            = ProcessWindowStyle.Hidden,
             CreateNoWindow         = true
         };
         Process M = Process.Start(start);
         botSetting.Id = M.Id;
     }
     else
     {
         ProcessStartInfo start = new ProcessStartInfo("AutoIt3.exe")
         {
             Arguments              = ProcessName + " " + botSetting.ProfileName + " " + botSetting.Emulator + " " + botSetting.Instance + " " + "-a" + " " + "-nwd" + " " + "-nbs",
             RedirectStandardError  = false,
             RedirectStandardOutput = false,
             WindowStyle            = ProcessWindowStyle.Hidden,
             CreateNoWindow         = true
         };
         Process M = Process.Start(start);
         botSetting.Id = M.Id;
     }
 }
コード例 #2
0
ファイル: Worker.cs プロジェクト: PoH98/MyBot.Supporter
 private void NotInTime(BotSetting botSetting)
 {
     if (!botSetting.Id.HasValue)
     {
         return;
     }
     try
     {
         if (!AndroidKiller.Close(botSetting.Emulator, botSetting.Instance))
         {
             KillProcessAndChildren(botSetting.Id.Value);
         }
         else
         {
             var mbr = Process.GetProcessById(botSetting.Id.Value);
             mbr.CloseMainWindow();
             mbr.Close();
         }
     }
     catch
     {
     }
     botSetting.Id = null;
 }