mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Get file and folder working
This commit is contained in:
@@ -74,25 +74,46 @@ namespace SabreTools
|
||||
Process.Start("DATabase.exe", "-l -ga");
|
||||
}
|
||||
|
||||
private void exploreButton_Click(object sender, EventArgs e)
|
||||
private void fileButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
OpenFileDialog ofd = new OpenFileDialog();
|
||||
|
||||
// Set the proper starting folder
|
||||
if (importTextBox.Text != "")
|
||||
{
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(importTextBox.Text);
|
||||
ofd.InitialDirectory = Path.GetDirectoryName(importTextBox.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
ofd.InitialDirectory = Environment.CurrentDirectory;
|
||||
ofd.InitialDirectory = Environment.CurrentDirectory;
|
||||
}
|
||||
|
||||
// Set the new folder, if applicable
|
||||
// Set the new file, if applicable
|
||||
if (ofd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
importTextBox.Text = ofd.FileName;
|
||||
}
|
||||
}
|
||||
|
||||
private void folderButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
FolderBrowserDialog fbd = new FolderBrowserDialog();
|
||||
|
||||
// Set the proper starting folder
|
||||
if (importTextBox.Text != "")
|
||||
{
|
||||
fbd.SelectedPath = Path.GetDirectoryName(importTextBox.Text);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbd.SelectedPath = Environment.CurrentDirectory;
|
||||
}
|
||||
|
||||
// Set the new folder, if applicable
|
||||
if (fbd.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
importTextBox.Text = fbd.SelectedPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user