Feedback

Open File Dialog

Sprache: C#

Open File Dialog mit Filter
string Pfad = string.Empty;

OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
if(openFileDialog1.ShowDialog() == DialogResult.OK)
    Pfad = openFileDialog1.FileName;
string Pfad = string.Empty;

OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
if(openFileDialog1.ShowDialog() == DialogResult.OK)
    Pfad = openFileDialog1.FileName;

5 Kommentare