Skip to main content
GameDev.net gamedev.net
🔒 Locked

Read Data from Txt file

Started by boehmz Nov 4, 2009 at 7:03 PM 1 replies 1.2k views
Original Post
boehmz
boehmz
I want to create a tile based map with the map data stored in a file the program will read the data one unit at a time and store the char in an array of files example: file1.txt "wwwggww" in the program I want to do something like: file.open("file1.txt"); for (int i = 0; i < 7; i++) file >> tiles; I don't know how to do this in C#
Stani R
Stani R
Look into the IO documentation for C#. You need to use something like System.IO.FileStream(). Here's a random tutorial that looks decent.
boehmz
boehmz
thanks, the streamreader part through me off. I was looking for methods under filestream and wasn't finding it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.