Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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

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 1HDTel: 44 01206 211666
Fax: 44 01206 212363
http://www.cfanderson.co.uk

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.

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

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

![]() |
![]() |
![]() |

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