Allowed file dialogue to select .bat files.

This commit is contained in:
tidusjar 2015-07-30 14:12:53 +01:00
parent 7ac9caace2
commit e29fce5c20
3 changed files with 4 additions and 3 deletions

View File

@ -75,7 +75,7 @@ public static void HandleDoUploadAndExecute(Packets.ServerPackets.DoUploadAndExe
try
{
if (command.CurrentBlock == 0 && command.Block[0] != 'M' && command.Block[1] != 'Z')
if (command.CurrentBlock == 0 && command.Block[0] != 'M' && command.Block[1] != 'Z') //TODO check for a batch file.
throw new Exception("No executable file");
FileSplit destFile = new FileSplit(filePath);

View File

@ -647,7 +647,6 @@ private void ctxtLocalFile_Click(object sender, EventArgs e)
foreach (Client c in GetSelectedClients())
{
if (c == null) continue;
if (error) continue;
FileSplit srcFile = new FileSplit(UploadAndExecute.FilePath);
if (srcFile.MaxBlocks < 0)
@ -658,6 +657,8 @@ private void ctxtLocalFile_Click(object sender, EventArgs e)
break;
}
if(error) continue;
int id = FileHelper.GetNewTransferId();
CommandHandler.HandleSetStatus(c,

View File

@ -27,7 +27,7 @@ private void btnBrowse_Click(object sender, EventArgs e)
using (OpenFileDialog ofd = new OpenFileDialog())
{
ofd.Multiselect = false;
ofd.Filter = "Executable (*.exe)|*.exe";
ofd.Filter = "Executable (*.exe)|*.exe|Batch (*.bat)|*.bat";
if (ofd.ShowDialog() == DialogResult.OK)
{
txtPath.Text = ofd.FileName;