create .txt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjainpee
    New Member
    • Apr 2008
    • 9

    create .txt

    Hi All,
    I m new to asp.net

    I want to make a notepad file through .net at run time ,put some text in the file and save the file at some location on the system and the file should be in open mode automaticaly (user dont need to open the file )
    is it possible ?
    Please give examples in c# only

    Please Help
    Thanks in advance
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Read about how to use a TextWriter.

    Comment

    • Curtis Rutland
      Recognized Expert Specialist
      • Apr 2008
      • 3264

      #3
      You'll find that you can't do this with ASP.NET the way you want. Remember that everything with ASP.NET happens on the server, so when you create the text file, you will actually be creating it on the server, not the client machine. To do this properly, you could create the file on the server's machine, and then present it to the user for download.

      Read this to learn how to use a StreamWriter to create a text file. I think that they are the easiest way to make text files. Just make sure that you close the stream when you are done.

      Comment

      Working...