vb.net - Saving to text not showing anything in 'save file type' -


hi trying save text file rich text box following code , not saving , not giving option save file type when saving prompt comes up:

    private sub button1_click(byval sender system.object, byval e system.eventargs)  handles button1.click     dim sfd new savefiledialog     sfd.showdialog()     dim mypath string = sfd.filename     fileopen(1, "mypath", openmode.output)     printline(1, richtextbox1.text)     fileclose(1) 

try ...

private sub button1_click(byval sender system.object, byval e system.eventargs)  handles button1.click         dim sfd new savefiledialog     dim filename string = ""     dim mysafefilename string = ""              try         sfd             .initialdirectory = "d:\mypath\data"  ' --> put yor full path here             .filename = mysafefilename             .filter = "text files (*.txt)|*.txt|"             if .showdialog() = dialogresult.ok                 filename = .filename                 fileopen(1, filename , openmode.input)                 printline(1, richtextbox1.text)                 fileclose(1)                                 end if         end     catch ex system.exception         msgbox(ex.message)            end try end sub 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -