Computing.Net > Forums > Programming > I need help with using files in C#

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

I need help with using files in C#

Reply to Message Icon

Name: El-Trucha
Date: April 9, 2005 at 18:59:57 Pacific
OS: Windows XP SP2
CPU/Ram: 2.8 GHz/448 MB
Comment:

OK...I was wandering...how do programs make their own filetypes?? do they do this with databases?? if they do, how can I use one (a database) in a file?? I mean, without a server or M$ Access...
I made a game that saves scores to INI files, and I want to use my own filetype instead of INI...
I'm doing this in C#.
Thanx every1!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx



Sponsored Link
Ads by Google

Response Number 1
Name: CharlesAnderson
Date: April 10, 2005 at 08:09:29 Pacific
Reply:

Here is the solution you need:

http://www.mentalis.org/soft/class.qpx?id=5

love is free to all

Charles Anderson

cba@cfanderson.co.uk

228 London Road
Marks Tey
Colchester
Essex
CO6 1HD

Tel: 44 01206 211666
Fax: 44 01206 212363
http://www.cfanderson.co.uk


0

Response Number 2
Name: anonproxy
Date: April 10, 2005 at 22:54:44 Pacific
Reply:

A filetype is an abstract thing. It could mean a proprietary binary encoding or just a plaintext file with a random extension. A format may be anything from an HTML file to a PE.

To you, the programmer, all that matters is that you can read and edit the file contents. File extensions/associations have nothing to do with this. Typically programmers use standard file formats which often are supported by major libraries. It's common to have interfaces (classes, what have you) to write, read, modify standard file formats. These are typically built on top of the base file manipulation classes.

There can be more than one way to do this. In your case, I might use a CSV file. I think .NET has a System.Data.ODBC interface that allows you to read a CSV file into a dataset and then perform queries on it. Of course, you could just use a System.IO.File derivative, but then you would have to observe the formatting more carefully. Finally, you could roll your own class to handle reading/writing CSV files.

Databases, mail clients, spreadsheet programs, etc. typically export to CSV.



0

Response Number 3
Name: El-Trucha
Date: April 11, 2005 at 19:25:26 Pacific
Reply:

Thanx both of u!! :D
I'll look up on MSDN how to use ODBC...thanx!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx


0

Response Number 4
Name: shriop
Date: April 26, 2005 at 14:10:27 Pacific
Reply:

Keep in mind benchmarks for using this approach. At very least, use the OLE adapter instead of the ODBC.

some pages with benchmarks:
http://www.geocities.com/shriop/csv_benchmarks.html
http://www.codeproject.com/cs/database/CsvReader.asp


0

Response Number 5
Name: El-Trucha
Date: April 30, 2005 at 23:40:34 Pacific
Reply:

Thanx for that!! ;)

El-Trucha
http://www.truchasoft.tk
ftp://tsfc.homeftp.net
hotline://tsfc.ath.cx


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: I need help with using files in C#

need help with char pointers in C++ www.computing.net/answers/programming/need-help-with-char-pointers-in-c/12633.html

Need help with an SQL join query www.computing.net/answers/programming/need-help-with-an-sql-join-query/13358.html

I need help with bat file - please help www.computing.net/answers/programming/i-need-help-with-bat-file-please-help/2971.html