Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

i cant get this working at all

 

all it does is say it has illegal letters

 

        SaveFileDialog.Title = ("Save File")
       SaveFileDialog.Filter = ("HTML (*.html*)|*.html*|HTM (*.htm*)|*.htm*|XHTML (*.xhtml*)|*.xhtml*|XML (*.xml*)|*.xml*|PHP (*.php*)|*.php*|PHP3 (*.php3*)|*.php3*|PHP4 (*.php4*)|*.php4*|PHTML (*.phtml*)|*.phtml*|ASP (*.asp*)|*.asp*|ASPX (*.aspx*)|*.aspx*")
       Me.SaveFileDialog.ShowDialog()
       Dim oFile As System.IO.File
       Dim oWrite As System.IO.StreamWriter
       oWrite = oFile.CreateText(SaveFileDialog.FileName & "." & SaveFileDialog.Filter)
       oWrite.WriteLine(TextBox.Text)
       oWrite.Close()

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

  • *Experts*
Posted

Without getting into editting, here's an example of a SaveFile method.

 

With SaveFileDialog1
   .InitialDirectory = 'some directory
   .Filter = "Volts worksheet (*.elc)|*.elc|Binary (*.bin)|*.bin"
   .DefaultExt = "elc"
   .Title = "Save File As"
   .FileName = 'your file name
End With
If SaveFileDialog1.ShowDialog() = DialogResult.Cancel Then
    'blah
Else
    SaveListView(SaveFileDialog1.FileName)
    worksheetName = FilenameOnly(SaveFileDialog1.FileName)
    Add_2OpenedFiles(SaveFileDialog1.FileName)
    worksheetModified = False
End If

 

Hope that gives you some ideas.

Dan

Member, in good standing, of the elite fraternity of mentally challenged programmers.

 

Dolphins Software

Posted

but im using more than 1 extension

and if i set the DefaultExt it only saves it as that

EG

       SaveFileDialog.FileName = ("MyDoc1")
       SaveFileDialog.DefaultExt = "html"

 

saves it as:

MyDoc1.html

and if i select the ASP one it saves it as

MyDoc1.html

Page Edit 2.0 Alpha 2 OUT NOW!

- Download Now -

  • Administrators
Posted
The filter is only used to restrict the files displayed in the dialog box - not to alter the final name entered by the user. The DefaultExt property is only applied to the file name if the user provides a filename without specifying an extension as documented in MSDN.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

You have : "HTML (*.html*)|*.html*"

Remove the trailing * to give you

HTML (*.html)|*.html|

Do the same with all the other extensions.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...