Filter property of openfiledialog not working

c#, file-extension, filter, openfiledialog

Solution

You have a space after the extension `*.b` in the filter property This will work

ofd.Filter = "Brainscramble-Dateien (*.b)|*.b|Alle Dateien (*.*)|*.*";

Curiously, the space in front is not a problem

Problem

i am close to finishing a brainfuck ide for my c# project in school. one of the problems nagging me is that the filter of the openfiledialog does not work when i try to open a .b code file. i save a file with the extension .b in notepad, then i try to open it with the ide. only problem ist, when i choose *.b-Files from the extension dropdown, i dont get any files displayed, just folders. when i choose to display any file, it works fine. any ideas? here is my method for opening the file: ``` public void oeffnenDatei() { OpenFileDialog ofd = new OpenFileDialog (); ofd.InitialDirectory = "C:\\"; ofd.Multiselect = false; ofd.Filter = "Brainscramble-Dateien (*.b) | *.b | Alle Dateien (*.*)|*.*"; if ( ofd.ShowDialog () == DialogResult.OK ) { addTab ( ofd.SafeFileName ); StreamReader reader = new StreamReader ( ofd.FileName ); setCode ( reader.ReadToEnd () ); } } ```

Original source