Hello, is possible in C# create a file with custom extension? and the file can be open only from progra and not from others text editors.

I have a login form were i store logs in txt file for now, that i want is to create an file named *.lst and store in this file all informations i want, but as i say i dont want to open it from text-editors only program can open it...

any idea how things like this work?

Recommended Answers

All 2 Replies

// creates your file
FileStream fs = new FileStream(@"yourPath\*.lst", FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite);

u can open any file on text editors, u can encrypt the data if you do not want others to read the data, but encrypting into a binary file and reading it back would be based on your structure how u write it and read the same way u write the data.
// creates your file
FileStream fs = new FileStream(@"yourPath\*.lst", FileMode.OpenOrCreate, FileAccess.Write, FileShare.ReadWrite);

u can open any file on text editors, u can encrypt the data if you do not want others to read the data, but encrypting into a binary file and reading it back would be based on your structure how u write it and read the same way u write the data.

i know this way, but i dont have idea how to encrypt data thats why i looking for other way were byself data cant be open from other programms...
anyway any idea about encryption?
maby convert string to binary and then encrypt binary?

something like

String: Hello,
Binary: 1010101???
Encrypt: something like take result and for each 1-0 add +1,
example result 0010 after encyption will be 1101

But is week to decrypt it e?

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.