its maybe a really dummie question but I was wondering is there any way to create a file (like txt) that the program can use its data but the users can't access it ? sql is an option but the data aren't large enough to be used. is there any other file type or way to do this?

Recommended Answers

All 3 Replies

You can use a text file as a datasource (flat files). But you cannot keep the user from accesing it. You can, however encrypt the data so that they cannot interpret the data it contains. You can also give the file an odd extension so that the user does not know what the file is for. e.g.g MyData.trr

In Unix/Linux and similar systems, you can set the file's attributes so that ONLY the owner or administrator (root) can access the file. As for program access only, then the only means is to encrypt the file, and allow the user to specify the password on the command line. Combined with file attributes, this would keep anyone but the owner who knows the password from accessing the file and its contents.

Anyway, since this is in the C# forum, I have to assume it is a Windows system, most likely. In that case, you really need to encrypt the file and keep the password secret.

Isolated Storage. It's not completely protected from user access, but not as open as arbitrary files.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.