Archived

This topic is now archived and is closed to further replies.

xyz

reading text files in c#...

Recommended Posts

Hi, I want to read a text file that is something like this: Version 1 NumMeshes 1 NumFaces 1274 Now, in c++, I would do like this: fscanf(file, "NumMeshes %d\n", &m_iNumMeshes); Is there anything similar in c#? If not, whats the best way to read this? Thanks

Share this post


Link to post
Share on other sites
Off the top of my head, I can''t think of any facilities in C# that work as simply as the C method. You might want to try using a StreamReader object to read in the individual lines and then hack apart the Strings manually. I don''t do a lot of file processing in C#, so this may not be the best way.

Share this post


Link to post
Share on other sites