Streamwriter

Streamwriter

Postby Warren1001 » 16 Jul 2013, 03:06

What's the coding for streamwriter?
using something steamwriter ( path of file )
then like x.writeline("");
i can't seem to find a command that has it
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50

Re: Streamwriter

Postby ismellike » 16 Jul 2013, 03:09

I make almost all of my commands that use a text file with streamwriter, but I use the top example here.

You can try this.
Code: Select all
using(var sw = new StreamWriter(path))
{
   sw.WriteLine("Some stuff");
}


or you can do this

Code: Select all
StreamWriter sw = new StreamWriter(path);
sw.WriteLine("Some stuff");
sw.Flush(); //stops editing/closes file
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: Streamwriter

Postby Warren1001 » 16 Jul 2013, 03:11

Ty:3
Warren1001
 
Posts: 197
Joined: 08 Aug 2012, 03:50


Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 1 guest

cron