Export Stability

Cleaning the filenames of bad characters \ automatically.
This commit is contained in:
Kurt
2014-07-14 11:44:40 -07:00
parent 6ee3bc71f0
commit 8dd52069ca

View File

@@ -6913,19 +6913,20 @@ private void dragout_MouseDown(object sender, MouseEventArgs e)
// Strip out party stats (if they are there)
Array.Resize(ref dragdata, 232);
// Make File
string newfile = basepath + "\\" + CleanFileName(filename);
try
{
File.WriteAllBytes(basepath + "\\" + filename, dragdata);
File.WriteAllBytes(newfile, dragdata);
string[] filesToDrag = { basepath + "\\" + filename };
string[] filesToDrag = { newfile };
dragout.DoDragDrop(new DataObject(DataFormats.FileDrop, filesToDrag), DragDropEffects.Move);
File.Delete(basepath + "\\" + filename);
File.Delete(newfile);
}
catch (ArgumentException x)
{
MessageBox.Show("Drag&Drop Error\r\n" + x, "Error");
}
File.Delete(basepath + "\\" + filename);
File.Delete(newfile);
}
}
private void dragout_DragOver(object sender, DragEventArgs e)
@@ -6947,19 +6948,20 @@ private void eragout_MouseDown(object sender, MouseEventArgs e)
// Strip out party stats (if they are there)
Array.Resize(ref dragdata, 232);
// Make file
string newfile = basepath + "\\" + CleanFileName(filename);
try
{
File.WriteAllBytes(basepath + "\\" + filename, dragdata);
File.WriteAllBytes(newfile, dragdata);
string[] filesToDrag = { basepath + "\\" + filename };
string[] filesToDrag = { newfile };
dragout.DoDragDrop(new DataObject(DataFormats.FileDrop, filesToDrag), DragDropEffects.Move);
File.Delete(basepath + "\\" + filename);
File.Delete(newfile);
}
catch (ArgumentException x)
{
MessageBox.Show("Drag&Drop Error\r\n" + x, "Error");
}
File.Delete(basepath + "\\" + filename);
File.Delete(newfile);
}
}
private void eragout_DragOver(object sender, DragEventArgs e)
@@ -8147,7 +8149,7 @@ private void Menu_DumpLoadBoxes_Click(object sender, EventArgs e)
Array.Resize(ref pkxdata, 232);
if (!File.Exists(path + "\\" + savedname))
{
File.WriteAllBytes(CleanFileName(path + "\\" + savedname), pkxdata);
File.WriteAllBytes(path + "\\" + CleanFileName(savedname), pkxdata);
}
}
}