its a web app so i cant use saveasDialog need to save content of stringbuilder

Posted by ryder1211212 on Stack Overflow See other posts from Stack Overflow or by ryder1211212
Published on 2010-03-18T18:58:24Z Indexed on 2010/03/18 19:01 UTC
Read the original article Hit count: 492

i am using C# and its a web app so i cant use saveasDialog i have a stringbuilder called builder and i would like to say the contents to a file in a specific location

i would also like the name to be dynamic am using this

              FileInfo t = new FileInfo(@"C:\DocUpload\swDoc\" + lbfilename.text);
              TextWriter w = t.CreateText();

              w.Write(builder.ToString());
              w.Flush();
              w.Close();

but for some reason it creats a corrupt file or none at all

any suggestions is welcomed thanks alot

© Stack Overflow or respective owner

Related posts about c#

Related posts about stringbuilder