Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Streaming in C#

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,611
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 6, 2010

This isn't a Unity video, but it can be applied to Unity. What I show here is how to use the StreamWriter and StreamReader and Convert Classes in C#

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:
see all

All Comments (5)

Sign In or Sign Up now to post a comment!
  • @messi996 You have to open up a steam and do Stream.writeline essentially

  • hey guys maybe i miss somthing but does anyone know how use this to write a Console.Writeline into a txt file.

  • @wwwsant But again, this wasn't supposed to be anything like, "Oh, this is the best way to do it!" it was, "Oh, well, before we did it this long way, this time lets do it the short and much easier route.

  • @wwwsant This was an extension onto my previous saving out into a text file code tutorial. It wasn't meant as anything super efficient, just talking about things out there.

    Problem with sr.ReadLine, is you don't have as exact control over what you are reading when. Now, I don't thing it was a problem here, but you get my point.

    System.Convert.ToInt32 is regional, if in your country, you use commas for decimals, it will work. Only problem I see with that, is if you have english code....

  • sr.ReadToEnd().Split('\n') is horribly inefficient and wrong (on windows CrLf files).

    Why not simply use sr.ReadLine? Convert.ToInt32 and family have a load of assumptions about current culture (locale) and will not only break, but silently interpret into the _wrong_ values if you don't specificly make sure what format is being parsed.

    Other mechanisms (e.g. Xml) nicely prevent this kind of mess, and you can always use .NET serialization with formatters if you need bleeding performance

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more