SaveFileDialog is not correctly working


hello everybody,
i have code.. saves content of richtextbox
 private void savetoolstripmenuitem_click(object sender, eventargs e)          {                            string all_ = richtextbox1.text;              string filename = null;                savefiledialog1.title = "save html file";              savefiledialog1.filter = "html files|*.html";              savefiledialog1.filename = "unititled document";              savefiledialog1.initialdirectory = "c:";              if (filename == null)              {                  if (savefiledialog1.showdialog() != dialogresult.cancel)                  {                     richtextbox1.savefile(all_, richtextboxstreamtype.plaintext);                                        }                                                  }          }

and example of richtextbox containing

<!doctype html>  <html>  <head>  <title>new document</title>    </head>  <body>      </body>  </html>


when clicking on save menu  item excute code, save dialog shows correctly.. when press save button in dialog box.. gives me error "illegal characters in path"

and picture of it

so failed in fixing :(

please give me possible , thank much

nothing savefiledialog, you're passing wrong parameter savefile. first parameter should file name instead you're passing all_ textbox text. you're not getting file name selected user in dialog filename property.



Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'