Autor Beitrag
Ph@r@oXX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40



BeitragVerfasst: Fr 29.08.08 08:13 
Hey mir ist grade aufgefallen das mein Pfad immer nur den Ausgangspfad anzeigt was mir auch kla is warum xD (öffnungspfad = anzeigepfad xD) !! Allerdings will ich das mir die textbox den komplettenpfad anzeigt den ich zuletzt geöffnet hatte ! was muss ich dazu ändern ?

ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
private void button_Click(object sender, EventArgs e)
        {
            openFileDialog.InitialDirectory = @"C\";
            
            openFileDialog.Filter = "Icon|*.ico|PNG|*.png*";
            //OpenFileDialog dlgFileOpen = new OpenFileDialog(); 
            if (openFileDialog.ShowDialog() == DialogResult.OK)
                textEdit1.Text = openFileDialog.InitialDirectory;
            //openFileDialog.ShowDialog();
        }


Gruß
Ph@r@oXX


Moderiert von user profile iconChristian S.: Topic aus Basistechnologien verschoben am Fr 29.08.2008 um 10:51
Skiller-1988
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 100

Win XP | Debian | Ubuntu
C# | PHP | VB.NET
BeitragVerfasst: Fr 29.08.08 08:52 
Ja eine möglickeit wäre:
ausblenden C#-Quelltext
1:
textEdit1.Text = openFileDialog.FileName;					


Allerdings ist dann auch Dateiname und endung enthalten.

_________________
~ Wer Rechtschreibfehler findet darf sie behalten ~
Skiller-1988
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 100

Win XP | Debian | Ubuntu
C# | PHP | VB.NET
BeitragVerfasst: Fr 29.08.08 09:00 
Wenn du allerdings wirklich nur den Pfad zum Ordener benötigst aso ohne Dateinamen dann:

ausblenden C#-Quelltext
1:
2:
                FileInfo fi = new FileInfo(openFileDialog.SafeFileName);
                textEdit1.Text = fi.Directory.ToString();

_________________
~ Wer Rechtschreibfehler findet darf sie behalten ~
Ph@r@oXX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 40



BeitragVerfasst: Fr 29.08.08 09:09 
okay danke ich werds mal probieren ?!