Jump to content
Sign in to follow this  
metalicaman8

Saving data

Recommended Posts

metalicaman8

I was wondering if there is any way to save your data without saving to an external file. If there is no such way then how do you save it to an external file such as a text file and is there a way to make this file hidden? Thank you in advance.

Share this post


Link to post
Share on other sites
Swift

You can store information inside a variable. Or, use a file and then use: FileSetAttrib() and set it to: +SH :)

Share this post


Link to post
Share on other sites
SkinnyWhiteGuy

Look into Data Streams on NTFS drives.

Share this post


Link to post
Share on other sites
metalicaman8

Look into Data Streams on NTFS drives.

Got that figured out and its very useful thanks.

Now I need to know how to save data to a text file. I know you can call commands from the au3 file but I can read about the specifics later in the help file. I can't figure out how to save data to a text file though. Also, can say test.au3 read and save to data stream file test.au3:hidden.txt?

Thank you again.

Share this post


Link to post
Share on other sites
metalicaman8

Never mind saving to external text file I figured it out. I'm trying to make a modification on the encryptor that comes in the examples that saves your data to a text file hidden in an alternate data stream. To save I am doing this

CODE
$Msg = GuiGetMsg()

If $msg = $EncryptButton Then

; When you press Encrypt

;~~

GuiSetState(@SW_DISABLE,$WinMain)

; Stops you from changing anything

;~~

$string = GuiCtrlRead($EditText)

; Saves the editbox for later

;~~

GUICtrlSetData($EditText,'Please wait while the text is Encrypted/Decrypted.')

; Friendly message

;~~

GuiCtrlSetData($EditText,_StringEncrypt(1,$string,GuiCtrlRead($InputPass),GuiCtrlRead($InputLevel)))

; Calls the encryption. Sets the data of editbox with the encrypted string

;~~

FileOpen ("encryptor.au3:pass.txt", 2 )

FileWrite ("encryptor.au3:pass.txt", $EditText )

GuiSetState(@SW_ENABLE,$WinMain)

; This turns the window back on

;~~

EndIf

the fileopen and filewrite near the bottom are my additions.

To call the data back I am using this

CODE
$openthis = FileOpen ("encryptor.au3:pass.txt", 0)

$text = FileRead ( "encryptor.au3:pass.txt")

FileClose ($openthis)

and

CODE
$EditText = GuiCtrlCreateEdit( '' ,5,5,380,350)

; Creates main edit

;~~

GUICtrlSetData ($EditText,$text)

when I open the script for the first time all goes fine. When I open any time after that no matter what I try to encrypt the main edit box has a value of 3. When in dos prompt I query start encryptor.au3:pass.txt I get something about how I do not have permission to access the file. Please help.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×