C# handling files - What classes/methods to choose?

Electronics Computer Programming Q&A
Post Reply
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

C# handling files - What classes/methods to choose?

Post by atferrari »

I am learning C# by myself with no previous experience other than Basic (yes, the old one) and Assembler for micros. Not conversant in C, C++ or Java either. So please don't refer to them like most tutorials do.

Since the initial application I have in mind is to be file-handling intensive I want this straight from the beginning. There are so many options for working with files (creating / erasing / seeking / appending / deleting / listing and the like) that I find the list of objects/classes/methods somewhat overwhelming.

I have the feeling that there is not a "one fits all" solution but I would like to avoid wasting time trying to learn every single way, to find later that it was not worth the pain.

Honestly, every time I try to adavance on the subject, something new shows up adding to my confusion which increases even more with someone else saying:"this is the right thing to do!".

As you could see I am asking for the criteria to follow, not code.

Just in case, please keep all referred to Console output/input. I will work out my way for a graphic interface at a later moment.

Help is needed and appreciated. Gracias.
bodgy
Posts: 1044
Joined: Tue Dec 04, 2001 1:01 am
Location: Australia
Contact:

Post by bodgy »

For a console application, I'm pretty sure the only class you will need is system.io

Same as Visual Basic, you will need to decide if you are opening binary or text files etc.


Colin
On a clear disk you can seek forever.
User avatar
atferrari
Posts: 24
Joined: Sat Nov 22, 2008 11:02 pm
Location: Buenos Aires - Argentina
Contact:

Thanks

Post by atferrari »

Thanks for the reply.

I am quite busy with several vessels up to the end of the week. Once free I will resume the learning. Surely I will have to ask for help on the details.

Oh, yes, I have to find out the actual difference between binary and text.

Not confirmed, but I suspect that if you don't know what a file is (irrelevant name and no extension) in the beginning is just binary for you.

Rants aside I will revert with my homework done. Gracias :grin:
riki
Posts: 6
Joined: Sun Dec 13, 2009 4:34 am
Contact:

Re: C# handling files - What classes/methods to choose?

Post by riki »

I suggest that you goto sea and stay there.

For years you have been harping on about learning C both on this forum and on EPE.

It is quite obvious you do not have the skills to master this subject and suggest you go back to school to learn the basics.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests