|
-
Nov 16th, 2000, 11:50 PM
#1
Thread Starter
Junior Member
ok, I am creating Dat files in Windows notepad to store info.How can I make this file so the users can't open it andread the info? Can it be done? If so how would i go about doing this?
Thanks Jason
-
Nov 17th, 2000, 12:26 AM
#2
To make it so that users can't read it, you'd have to encrypt your text. But here is how to make it so other programs cannot open your file or read it. In other words, lock it.
Code:
Open "MyTXT.txt" For Output Lock Read Write As #1
Print #1, "MyText"
Close #1
-
Nov 17th, 2000, 07:49 AM
#3
Originally posted by Matthew Gates
...In other words, lock it....
Code:
Open "MyTXT.txt" For Output Lock Read Write As #1
Print #1, "MyText"
Close #1
This lock is only temporary as long as the file is opened. So by using the close statement the file is unlocked again...not?
-
Nov 17th, 2000, 08:38 AM
#4
Fanatic Member
If you print your files using the
Code:
open "text.dat" for output as #1
print #1, "your text"
close #1
then your file will be seen using notepad. Using the lock function will only work while your application still is active and running.
Another idea would be to write your file in bytes, i.e. convert the data you need to bytes and specify where you write them to, i.e.:
Code:
dim myplace as byte
dim myvalue as integer
open "text.dat" for binary output as #1
input #1, myplace, myvalue
close #1
Of course before using this function you need to convert values and find a way to convert them to bytes.
Another solution: write a txt file using the first code. Fill your file with random numbers and characters, and then just point out the ones you need to compose your data (eg on position 13 you have the firsts letter, etc.). This is kind of encrypting.
Hope this helps,
W.
[Edited by wildcat_2000 on 11-17-2000 at 08:41 AM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|