stopping access
stopping access
<p>
Ok well how would i go about stoping access to a text file that is use in my QBASIC program? can be this be done?
Ok well how would i go about stoping access to a text file that is use in my QBASIC program? can be this be done?
You're being very unclear. Try again. Use proper punctuation, use something else instead of red, which clashes with white, and try to make your message understandable.
What you are asking for is impossible. You want a program that prevents people from accessing a file. The best thing to do is encrypt the file. Encrypting will make the file unreadable to anyone without the decrypter. Or you could save as binary, you could compress the file into your own format, or at the least you could rename the extension. for example, instead of file.txt you could have file.dat.
What you are asking for is impossible. You want a program that prevents people from accessing a file. The best thing to do is encrypt the file. Encrypting will make the file unreadable to anyone without the decrypter. Or you could save as binary, you could compress the file into your own format, or at the least you could rename the extension. for example, instead of file.txt you could have file.dat.
I have no sig.
i have come up with this code below but when u test it, it says file alredy open but i closed it can someone help
Code: Select all
CLS
OPEN "mac.dat" FOR INPUT AS #1
INPUT #1, S$
PRINT S$
IF S$ = "**** BLOCKED ****" THEN GOTO 12 ELSE GOTO 13
CLOSE #1
13 : PRINT "** THIS PROGRAM IS PASSWORD PROTECTED **"
PRINT "* ENTER PASSWORD *"
INPUT pass$
IF pass$ = "king" THEN GOTO 1 ELSE GOTO 3
3 PRINT "*** FAIL ***"
PRINT "** ENTER PASSWROD **"
INPUT pass$
IF pass$ = "king" THEN GOTO 1 ELSE GOTO 4
4 PRINT "** FAIL **"
PRINT "*** ENTER PASSWORD ***"
INPUT pass$
IF pass$ = "king" THEN GOTO 1 ELSE GOTO 5
5
12 :
OPEN "file.txt" FOR OUTPUT AS #1
PRINT #1, "**** BLOCKED ****"
CLOSE #1
PRINT "********* BLOCKED **********"
END
1 PRINT "** Access Granted **"
END
Well, it can be done in QB.
You have a file, that is encrypted.
If the file is missing, lock down the program.
If the unencrypted thing says "locked" lock down the program.
Most secure you can go.
Or you could just store the file in let's say:
C:\Windows\System\MSWDLL.DRV
Or some other equally cryptic name.
Just make sure to store the path as CHR$() statements and not plaintext, as plaintext can be easily found.
You have a file, that is encrypted.
If the file is missing, lock down the program.
If the unencrypted thing says "locked" lock down the program.
Most secure you can go.
Or you could just store the file in let's say:
C:\Windows\System\MSWDLL.DRV
Or some other equally cryptic name.
Just make sure to store the path as CHR$() statements and not plaintext, as plaintext can be easily found.
I have left this dump.
-
- Coder
- Posts: 23
- Joined: Sun Oct 03, 2004 10:26 pm
- Location: Prince George, BC, Canada
-
- Coder
- Posts: 23
- Joined: Sun Oct 03, 2004 10:26 pm
- Location: Prince George, BC, Canada
and optimize that spag...
ahh.... much better[/code]
Code: Select all
CLS
OPEN "mac.dat" FOR INPUT AS #1
INPUT #1, S$
PRINT S$
IF S$ = "**** BLOCKED ****" THEN GOTO Block ELSE GOTO Pass
CLOSE #1
Pass:
PRINT "** THIS PROGRAM IS PASSWORD PROTECTED **"
For a=1 to 3
PRINT "* ENTER PASSWORD *"
INPUT pass$
IF pass$ = "king" THEN GOTO Access
PRINT "*** FAIL ***"
NEXT a
Block:
OPEN "file.txt" FOR OUTPUT AS #1
PRINT #1, "**** BLOCKED ****"
CLOSE #1
PRINT "********* BLOCKED **********"
END
Access:
PRINT "** Access Granted **"
END
People laugh at me because I'm different, I laugh because there all the same... Soooo, if were all laughing, I fail to see the problem