Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 16th, 2004, 03:29 PM
Registered User
Join Date: Oct 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Differences between ASCII and Binary Files

Can someone help me figure out the difference between an ASCII file and a binary file as it pertains to reading and writing those kinds of files?

Many Thanks,


Reply With Quote
  #2 (permalink)  
Old October 17th, 2004, 07:22 PM
Kep Kep is offline
Authorized User
Join Date: Aug 2003
Location: Melbourne, VIC, Australia.
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts

I think what you're asking is how to read text files as opposed to binary files?

It just relates to how you deal with things like new lines, tabs and other special characters.

All files can be read using the FileStream object. This object allows you to read and write byte arrays to/from a file. This would be your option for a "binary" file (although you could read/write a text file using this object).

For text files you can use a StreamReader or StreamWriter. This allows you to read/write text files in a logical way, i.e. one line at a time into a string variable.

At the lowest level all files are stored as binary, it's just a matter of how you choose to view that file when reading or writing.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting an ASCII character to binary? skyraider Visual Basic 2005 Basics 0 May 7th, 2006 08:20 PM
hex conversion to binary files chrispbrown2255 C++ Programming 1 March 15th, 2006 06:06 PM
Format of Inet Object in vb6..ASCII/BINARY? ksrmramu VB How-To 0 October 18th, 2005 02:45 AM
Binary files MAXhYpe C# 0 November 2nd, 2004 04:42 AM
Reading from Binary Files jschmi J2EE 0 October 5th, 2004 01:09 AM

All times are GMT -4. The time now is 04:27 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.