How can i say that the data have a .txt ending?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • robin voo
    New Member
    • Oct 2011
    • 9

    How can i say that the data have a .txt ending?

    If the program opens the saveFileDialog:
    How can i say that the data have a .txt ending?
    Last edited by Niheel; Oct 20 '11, 04:48 PM.
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Have a look at the MSDN page for a SaveFileDialog. ..
    Fordert den Benutzer zur Auswahl eines Speicherorts für eine Datei auf. Diese Klasse kann nicht vererbt werden.

    (I even found you the German version :D)

    Check out the Filter property. This takes a specific string format which will tell the dialog how it will find data. It basically works like this...

    [quote]<description 1>|<pattern 1>|<descriptio n 2>|<pattern 2>|...|<descrip tion n>|<pattern n>"[/qouote]

    So the code from the MSDN page reads as...

    Code:
    SaveFileDialog sfd = new SaveFileDialog();
    sfd.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*";
    ... and this means your save file dialog will have two options in the drop down, text files (which is first and thus default) and all files.
    Last edited by Niheel; Oct 20 '11, 04:48 PM.

    Comment

    Working...