skip to Main Content

I am trying out ASP.NET right now and do not understand how to pass a stored information in a string into a textfile. How do I do it?

2

Answers


  1. With the download feature of js.

    Login or Signup to reply.
  2. string myString = "Sample String Text";
    //The @ character defines a verbatim string literal.
    using (StreamWriter sw = new StreamWriter(@"C:text.txt"))
       {
         sw.WriteLine(myString);
       }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search