private void openDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { if (_connectClient != null) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; PathType type = (PathType)item.Tag; if (type == PathType.Directory) { path = GetAbsolutePath(item.SubItems[0].Text); } } if (_connectClient.Value.FrmRs != null) { new Core.Packets.ServerPackets.DoShellExecute(string.Format("cd \"{0}\"", path)).Execute(_connectClient); _connectClient.Value.FrmRs.Focus(); } else { FrmRemoteShell frmRS = new FrmRemoteShell(_connectClient); frmRS.Show(); new Core.Packets.ServerPackets.DoShellExecute(string.Format("cd \"{0}\"", path)).Execute(_connectClient); } } }
private void openDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; FileType type = (FileType)item.Tag; if (type == FileType.Directory) { path = GetAbsolutePath(item.SubItems[0].Text); } } if (_connectClient.Value.FrmRs != null) { _connectClient.Send(new DoShellExecute { Command = $"cd \"{path}\"" }); _connectClient.Value.FrmRs.Focus(); } else { FrmRemoteShell frmRS = new FrmRemoteShell(_connectClient); frmRS.Show(); _connectClient.Send(new DoShellExecute { Command = $"cd \"{path}\"" }); } }
private void ctxtOpenDirectory_Click(object sender, EventArgs e) { if (_connectClient != null) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; if (item.SubItems[0].Text != ".." && item.Tag.ToString() == "dir") { if (path.EndsWith(@"\")) { path += item.SubItems[0].Text; } else { path += @"\" + item.SubItems[0].Text; } } } if (_connectClient.Value.FrmRs != null) { new Core.Packets.ServerPackets.ShellCommand(string.Format("cd \"{0}\"", path)).Execute(_connectClient); _connectClient.Value.FrmRs.Focus(); } else { FrmRemoteShell frmRS = new FrmRemoteShell(_connectClient); frmRS.Show(); new Core.Packets.ServerPackets.ShellCommand(string.Format("cd \"{0}\"", path)).Execute(_connectClient); } } }
private void remoteShellToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Client c in GetSelectedClients()) { FrmRemoteShell frmRs = FrmRemoteShell.CreateNewOrGetExisting(c); frmRs.Show(); frmRs.Focus(); } }
private void ctxtRemoteShell_Click(object sender, EventArgs e) { foreach (Client c in GetSelectedClients()) { if (c.Value.FrmRs != null) { c.Value.FrmRs.Focus(); return; } FrmRemoteShell frmRS = new FrmRemoteShell(c); frmRS.Show(); } }
private void ctxtRemoteShell_Click(object sender, EventArgs e) { if (lstClients.SelectedItems.Count != 0) { Client c = (Client)lstClients.SelectedItems[0].Tag; if (c.Value.FrmRs != null) { c.Value.FrmRs.Focus(); return; } FrmRemoteShell frmRS = new FrmRemoteShell(c); frmRS.Show(); } }
private void openDirectoryToolStripMenuItem_Click(object sender, EventArgs e) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; FileType type = (FileType)item.Tag; if (type == FileType.Directory) { path = GetAbsolutePath(item.SubItems[0].Text); } } FrmRemoteShell frmRs = FrmRemoteShell.CreateNewOrGetExisting(_connectClient); frmRs.Show(); frmRs.Focus(); frmRs.RemoteShellHandler.SendCommand($"cd \"{path}\""); }
private void ctxtOpenDirectory_Click(object sender, EventArgs e) { if (_connectClient != null) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; PathType type = (PathType)item.Tag; if (type == PathType.Directory) { path = GetAbsolutePath(item.SubItems[0].Text); } } if (_connectClient.Value.FrmRs != null) { new Core.Packets.ServerPackets.DoShellExecute(string.Format("cd \"{0}\"", path)).Execute(_connectClient); _connectClient.Value.FrmRs.Focus(); } else { FrmRemoteShell frmRS = new FrmRemoteShell(_connectClient); frmRS.Show(); new Core.Packets.ServerPackets.DoShellExecute(string.Format("cd \"{0}\"", path)).Execute(_connectClient); } } }
private void ctxtOpenDirectory_Click(object sender, EventArgs e) { if (_connectClient != null) { string path = _currentDir; if (lstDirectory.SelectedItems.Count == 1) { var item = lstDirectory.SelectedItems[0]; if (item.SubItems[0].Text != ".." && item.Tag.ToString() == "dir") { if (path.EndsWith(@"\")) path += item.SubItems[0].Text; else path += @"\" + item.SubItems[0].Text; } } if (_connectClient.Value.FrmRs != null) { new Core.Packets.ServerPackets.ShellCommand(string.Format("cd \"{0}\"", path)).Execute(_connectClient); _connectClient.Value.FrmRs.Focus(); } else { FrmRemoteShell frmRS = new FrmRemoteShell(_connectClient); frmRS.Show(); new Core.Packets.ServerPackets.ShellCommand(string.Format("cd \"{0}\"", path)).Execute(_connectClient); } } }
private void ctxtRemoteShell_Click(object sender, EventArgs e) { if (lstClients.SelectedItems.Count != 0) { Client c = (Client) lstClients.SelectedItems[0].Tag; if (c.Value.FrmRs != null) { c.Value.FrmRs.Focus(); return; } FrmRemoteShell frmRS = new FrmRemoteShell(c); frmRS.Show(); } }