Jump to content

Saving data


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...