Bilder werden wieder im Ausdruck angefügt

This commit is contained in:
HuskyTeufel
2020-08-10 09:23:05 +02:00
parent 55bce99509
commit ce1a17640b
3 changed files with 40 additions and 1 deletions

View File

@@ -61,7 +61,23 @@ namespace SanSystem
using (OpenFileDialog openFileDialog = new OpenFileDialog())
{
if (txt_schachtnummer.Text == "")
openFileDialog.InitialDirectory = @"C:\K2000w\BILDER";
{
bool found = false;
foreach(string directory in Directory.EnumerateDirectories(@"C:\K2000w\BILDER"))
{
if(directory.Contains(Global.Instance.ProjektNummer))
{
found = true;
openFileDialog.InitialDirectory = directory;
break;
}
}
if(!found)
{
openFileDialog.InitialDirectory = @"C:\K2000w\BILDER";
}
}
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
string source = openFileDialog.FileName;