User Profile

Collapse

Profile Sidebar

Collapse
Solemn
Solemn
Last Activity: Jun 9 '12, 11:59 AM
Joined: Jun 9 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Solemn
    replied to StreamRead/Write filename issue.
    Code:
    string fileName = Console.ReadLine();
    using (StreamWriter sw = new StreamWriter("D:\\" + fileName + ".txt", true))
                {
                    sw.WriteLine("LOL");
                }
    In my frustration, I answered the question on impulse.
    It was awesome and now my problem is solved.
    See more | Go to post

    Leave a comment:


  • Solemn
    started a topic StreamRead/Write filename issue.

    StreamRead/Write filename issue.

    in this example:

    Code:
    using (StreamWriter sw = new StreamWriter("D:\\BrugerID.txt", true))
    I want the "BrugerID" to be replaced with a variable. The variable should be a user input.

    In my perfect dream world the lines should be like this:

    Code:
    string fileNameToWrite = Console.ReadLine();
    using (StreamWriter sw = new StreamWriter("D:\\{0}.txt",fileNameToWrite, true))
    ...
    See more | Go to post
No activity results to display
Show More
Working...