Jump to content

crypt variable on the fly is possible ?


faustf
 Share

Recommended Posts

hi guys , is possible crypt a variable on the fly  ? 

#include <Crypt.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#NoTrayIcon


    Local $sSourceRead = "helloworld"
Local $sDestinationRead = (@ScriptDir &"\fattura_elettronica\FattureXML\B2C\risultato.txt")
Local $sPasswordRead ="lamiapass"
                If StringStripWS($sSourceRead, $STR_STRIPALL) <> "" And StringStripWS($sDestinationRead, $STR_STRIPALL) <> "" And StringStripWS($sPasswordRead, $STR_STRIPALL) <> ""  Then ; Check there is a file available to encrypt and a password has been set.
                    If _Crypt_EncryptVariable($sSourceRead, $sDestinationRead, $sPasswordRead, $CALG_AES_256) Then ; Encrypt the file.
                    ;   MsgBox($MB_SYSTEMMODAL, "Success", "Operation succeeded.")
                    Else
                        Switch @error
                            Case 30
                                MsgBox($MB_SYSTEMMODAL, "Error", "Failed to create the key.")
                            Case 2
                                MsgBox($MB_SYSTEMMODAL, "Error", "Couldn't open the source file.")
                            Case 3
                                MsgBox($MB_SYSTEMMODAL, "Error", "Couldn't open the destination file.")
                            Case 400 Or 500
                                MsgBox($MB_SYSTEMMODAL, "Error", "Encryption error.")
                            Case Else
                                MsgBox($MB_SYSTEMMODAL, "Error", "Unexpected @error = " & @error)
                        EndSwitch
                    EndIf
                Else
                    MsgBox($MB_SYSTEMMODAL, "Error", "Please ensure the relevant information has been entered correctly.")
                EndIf



Func _Crypt_EncryptVariable($sSourceFile, $sDestinationFile, $vCryptKey, $iAlgID)
 
    Local $dTempData = 0, _
            $hInFile = 0, $hOutFile = 0, _
            $iError = 0, $iExtended = 0, $iFileSize = BinaryLen($sSourceFile), $iRead = 0, _
            $bReturn = True

    _Crypt_Startup()
    If @error Then Return SetError(@error, @extended, -1)

    Do
        If $iAlgID <> $CALG_USERKEY Then
            $vCryptKey = _Crypt_DeriveKey($vCryptKey, $iAlgID)
            If @error Then
                $iError = @error
                $iExtended = @extended
                $bReturn = False
                ExitLoop
            EndIf
        EndIf
 
        $hInFile = StringToBinary($sSourceFile);, $FO_BINARY)
        If $hInFile = -1 Then
            $iError = 2
            $iExtended = _WinAPI_GetLastError()
            $bReturn = False
            ExitLoop
        EndIf
        $hOutFile = FileOpen($sDestinationFile, $FO_OVERWRITE + $FO_CREATEPATH + $FO_BINARY)

        If $hOutFile = -1 Then
            $iError = 3
            $iExtended = _WinAPI_GetLastError()
            $bReturn = False
            ExitLoop
        EndIf

        Do
            ;$dTempData = FileRead($hInFile, 1024 * 1024)
            $iRead += BinaryLen($hInFile)
            If $iRead = $iFileSize Then
                $dTempData = _Crypt_EncryptData($dTempData, $vCryptKey, $CALG_USERKEY, True)
                If @error Then
                    $iError = @error + 400
                    $iExtended = @extended
                    $bReturn = False
                EndIf
                FileWrite($hOutFile, $dTempData)
                ExitLoop 2
            Else
                $dTempData = _Crypt_EncryptData($dTempData, $vCryptKey, $CALG_USERKEY, False)
                If @error Then
                    $iError = @error + 500
                    $iExtended = @extended
                    $bReturn = False
                    ExitLoop 2
                EndIf
                FileWrite($hOutFile, $dTempData)
            EndIf
        Until False
    Until True

    If $iAlgID <> $CALG_USERKEY Then _Crypt_DestroyKey($vCryptKey)
    _Crypt_Shutdown()
    ;If $hInFile <> -1 Then FileClose($hInFile)
    If $hOutFile <> -1 Then FileClose($hOutFile)

    Return SetError($iError, $iExtended, $bReturn)
EndFunc   ;==>_Crypt_EncryptFile

when i try to decrypt not decript nothing 

Edited by faustf
Link to comment
Share on other sites

"on the fly"  ?

What script comportement are you waiting with that ? Or should i say i dont understand. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Developers
1 hour ago, faustf said:

hi guys , is possible crypt a variable on the fly  ? 

What about you try yourself to modify the encryptfile UDF you are trying to copy to make it encrypt the string instead of letting others do YOUR work as usual, and ONLY come back when you have an issue with YOUR modifications?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Could you provide us a reproducer of single simple encrypt decrypt ? 

 

I want to check if you know how to use that UDF. 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

I will send you a working exemple. 

Let me refresh my knowledge so i can assit you.

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Working Crypt. Dont remember where i took it but i dont have the credit of this script.

#include <Crypt.au3>
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>

Local $bAlgorithm = $CALG_RC4
Local $sFilePath = ""

GUICreate("File Encrypter", 425, 100)
Local $iSourceInput = GUICtrlCreateInput("", 5, 5, 200, 20)
Local $iSourceBrowse = GUICtrlCreateButton("...", 210, 5, 35, 20)

Local $iDestinationInput = GUICtrlCreateInput("", 5, 30, 200, 20)
Local $iDestinationBrowse = GUICtrlCreateButton("...", 210, 30, 35, 20)

GUICtrlCreateLabel("Password:", 5, 60, 200, 20)
Local $iPasswordInput = GUICtrlCreateInput("", 5, 75, 200, 20)

Local $iCombo = GUICtrlCreateCombo("", 210, 75, 100, 20, $CBS_DROPDOWNLIST)
GUICtrlSetData(-1, "3DES|AES (128bit)|AES (192bit)|AES (256bit)|DES|RC2|RC4", "RC4")
Local $iEncrypt = GUICtrlCreateButton("Encrypt", 355, 70, 65, 25)
GUISetState(@SW_SHOW)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit

        Case $iSourceBrowse
            $sFilePath = FileOpenDialog("Select a file to encrypt.", "", "All files (*.*)") ; Select a file to encrypt.
            If @error Then
                ContinueLoop
            EndIf
            GUICtrlSetData($iSourceInput, $sFilePath) ; Set the inputbox with the filepath.

        Case $iDestinationBrowse
            $sFilePath = FileSaveDialog("Save the file as ...", "", "All files (*.*)") ; Select a file to save the encrypted data to.
            If @error Then
                ContinueLoop
            EndIf
            GUICtrlSetData($iDestinationInput, $sFilePath) ; Set the inputbox with the filepath.

        Case $iCombo ; Check when the combobox is selected and retrieve the correct algorithm.
            Switch GUICtrlRead($iCombo) ; Read the combobox selection.
                Case "3DES"
                    $bAlgorithm = $CALG_3DES

                Case "AES (128bit)"
                    If @OSVersion = "WIN_2000" Then
                        MsgBox(16, "Error", "Sorry, this algorithm is not available on Windows 2000.") ; Show an error if the system is Windows 2000.
                        ContinueLoop
                    EndIf
                    $bAlgorithm = $CALG_AES_128

                Case "AES (192bit)"
                    If @OSVersion = "WIN_2000" Then
                        MsgBox(16, "Error", "Sorry, this algorithm is not available on Windows 2000.")
                        ContinueLoop
                    EndIf
                    $bAlgorithm = $CALG_AES_192

                Case "AES (256bit)"
                    If @OSVersion = "WIN_2000" Then
                        MsgBox(16, "Error", "Sorry, this algorithm is not available on Windows 2000.")
                        ContinueLoop
                    EndIf
                    $bAlgorithm = $CALG_AES_256

                Case "DES"
                    $bAlgorithm = $CALG_DES

                Case "RC2"
                    $bAlgorithm = $CALG_RC2

                Case "RC4"
                    $bAlgorithm = $CALG_RC4

            EndSwitch

        Case $iEncrypt
            Local $sSourceRead = GUICtrlRead($iSourceInput) ; Read the source filepath input.
            Local $sDestinationRead = GUICtrlRead($iDestinationInput) ; Read the destination filepath input.
            Local $sPasswordRead = GUICtrlRead($iPasswordInput) ; Read the password input.
            If StringStripWS($sSourceRead, 8) <> "" And StringStripWS($sDestinationRead, 8) <> "" And StringStripWS($sPasswordRead, 8) <> "" And FileExists($sSourceRead) Then ; Check there is a file available to encrypt and a password has been set.
                Local $iSuccess = _Crypt_EncryptFile($sSourceRead, $sDestinationRead, $sPasswordRead, $bAlgorithm) ; Encrypt the file.
                If $iSuccess Then
                     MsgBox(0, "Success", "Operation succeeded.")
                     FileDelete(@SCRIPTDIR & '\Settingstest.ini')
                Else
                    Switch @error
                        Case 1
                            MsgBox(16, "Error", "Failed to create the key.")
                        Case 2
                            MsgBox(16, "Error", "Couldn't open the source file.")
                        Case 3
                            MsgBox(16, "Error", "Couldn't open the destination file.")
                        Case 4 Or 5
                            MsgBox(16, "Error", "Encryption error.")
                    EndSwitch
                EndIf
            Else
                MsgBox(16, "Error", "Please ensure the relevant information has been entered correctly.")
            EndIf
    EndSwitch
WEnd

Working crypt/decrypt :

#include <Crypt.au3>

Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.

Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_RC4) ; Encrypt the data using the generic password string. The return value is a binary string.
MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted))
MsgBox(0, "Crypted data", "Nothing"&@CRLF&$bEncrypted)
MsgBox(0, "Crypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted))

$bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_RC4) ; Decrypt the data using the generic password string. The return value is a binary string.
MsgBox(0, "Decrypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted)) ; Convert the binary string using BinaryToString to display the initial data we encrypted.
MsgBox(0, "Decrypted data", "Nothing"&@CRLF&$bEncrypted)
MsgBox(0, "Decrypted data", "StringToBinary"&@CRLF&StringToBinary($bEncrypted))

For me it was very hard when i learned it.... From now i can understand everything from this script so easy ... You need help on that ?

 

I can notice directly that you changed the syntaxt... I will be able to help you only if you keep the correct syntaxt.

Crypt your inputs with the normal process then send the output in a file without Crypt UDF.

It s not needed to do everything in one time.

 

Edit: Added message box with crypted data in exemple 2 so you can see it is crypted then decrypted.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

questions ,  so i  use  your example for try to understand  how  work  crypt data ,  i modify  in this mode 

#include <Crypt.au3>

Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.

Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256) ; Encrypt the data using the generic password string. The return value is a binary string.
_True_write_File(@ScriptDir & "\keypress.txt", BinaryToString($bEncrypted))




; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Write data in File
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _True_write_File($sFilePath, $sDataWrite, $iReturn = 0)
    If $iReturn = Default Then $iReturn = 0

    $file = FileOpen($sFilePath, 1)
    If $iReturn = 0 Then
        FileWrite($file, $sDataWrite & @CRLF)
    Else
        FileWrite($file, $sDataWrite)
    EndIf
    FileClose($file)

EndFunc   ;==>_True_write_File

when i try to decrypt with 

example code decript file , it give me error ??

but  why ? ? 

Link to comment
Share on other sites

#include <Crypt.au3>

Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.

Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256) ; Encrypt the data using the generic password string. The return value is a binary string.
MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted))

;_True_write_File(@ScriptDir & "\keypress.txt", BinaryToString($bEncrypted))

$bEncrypted = _Crypt_DecryptData($bEncrypted, $sUserKey, $CALG_AES_256)
MsgBox(0, "Crypted data", "BinaryToString"&@CRLF&BinaryToString($bEncrypted))

semi unswer ;)

That mean the error is where ?

Does this can give you more idea on how it work ? ;)

$SettingsFile = @SCRIPTDIR & '\Settingstestcrypter.ini' 

$Login1  = IniRead ($SettingsFile, 'Login', 'Login1', "Corrigez le fichier ini svp")
$Login2  = IniRead ($SettingsFile, 'Login', 'Login2', "Corrigez le fichier ini svp")
$Login3  = IniRead ($SettingsFile, 'Login', 'Login3', "Corrigez le fichier ini svp")
$Login4  = IniRead ($SettingsFile, 'Login', 'Login4', "Corrigez le fichier ini svp")
$Login5  = IniRead ($SettingsFile, 'Login', 'Login5', "Corrigez le fichier ini svp")

$Pw1  = IniRead ($SettingsFile, 'Mot de passes', 'Pw1', "Corrigez le fichier ini svp")
$Pw2  = IniRead ($SettingsFile, 'Mot de passes', 'Pw2', "Corrigez le fichier ini svp")
$Pw3  = IniRead ($SettingsFile, 'Mot de passes', 'Pw3', "Corrigez le fichier ini svp")
$Pw4  = IniRead ($SettingsFile, 'Mot de passes', 'Pw4', "Corrigez le fichier ini svp")
$Pw5  = IniRead ($SettingsFile, 'Mot de passes', 'Pw5', "Corrigez le fichier ini svp")

$a1 = BinaryToString(_Crypt_DecryptData($Login1,$Password,$CALG_RC4))
$a2 = BinaryToString(_Crypt_DecryptData($Login2,$Password,$CALG_RC4))
$a3 = BinaryToString(_Crypt_DecryptData($Login3,$Password,$CALG_RC4))
$a4 = BinaryToString(_Crypt_DecryptData($Login4,$Password,$CALG_RC4))
$a5 = BinaryToString(_Crypt_DecryptData($Login5,$Password,$CALG_RC4))

$b1 = BinaryToString(_Crypt_DecryptData($Pw1,$Password,$CALG_RC4))
$b2 = BinaryToString(_Crypt_DecryptData($Pw2,$Password,$CALG_RC4))
$b3 = BinaryToString(_Crypt_DecryptData($Pw3,$Password,$CALG_RC4))
$b4 = BinaryToString(_Crypt_DecryptData($Pw4,$Password,$CALG_RC4))
$b5 = BinaryToString(_Crypt_DecryptData($Pw5,$Password,$CALG_RC4))

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

#include <FileConstants.au3>
#include <WinAPIFiles.au3>
#include <Crypt.au3>

    Local $hFileOpen = FileOpen($sFilePath, $FO_APPEND)
    Local Const $sFilePath = _WinAPI_GetTempFileName(@TempDir)
    
    If $hFileOpen = -1 Then
        MsgBox(0, "", "An error occurred whilst writing the temporary file.")
        Return False
    EndIf
    
    ;FileWrite($hFileOpen, _Crypt_EncryptData($Login1,$Password,$CALG_RC4))
    FileWrite($hFileOpen, "My saved Encrypted data : "&@CRLF&_Crypt_EncryptData($Login1,$Password,$CALG_RC4))
    ...
    ...
    ...

Or this :P

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

your  last example  work perfect , but i have  questions  why if i use my udf  function for write file not work ??

the  udf function is simply file open file write file close , where is a problem ?? 

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.5
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <Crypt.au3>

Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.

;Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256) ; Encrypt the data using the generic password string. The return value is a binary string.

;Local $hFileOpen = FileOpen (@ScriptDir & "\keypress.txt", $FO_APPEND)
; FileWrite($hFileOpen, _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256))

_True_write_File(@ScriptDir & "\keypress.txt", _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256),1)




; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Write data in File
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _True_write_File($sFilePath, $sDataWrite, $iReturn = 0)
    If $iReturn = Default Then $iReturn = 0

    $file = FileOpen($sFilePath, 1)
    If $iReturn = 0 Then
        FileWrite($file, $sDataWrite & @CRLF)
    Else
        FileWrite($file, $sDataWrite)
    EndIf
    FileClose($file)

EndFunc   ;==>_True_write_File

 

Link to comment
Share on other sites

but i i dont know  why not work also in this mode o_O

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.14.5
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <Crypt.au3>

Local Const $sUserKey = "CryptPassword" ; Declare a password string to decrypt/encrypt the data.
Local $sData = "..upon a time there was a language without any standardized cryptographic functions. That language is no more." ; Data that will be encrypted.

;Local $bEncrypted = _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256) ; Encrypt the data using the generic password string. The return value is a binary string.

Local $hFileOpen = FileOpen (@ScriptDir & "\keypress.txt", $FO_APPEND)
 FileWrite($hFileOpen, _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256))

;_True_write_File(@ScriptDir & "\keypress.txt", _Crypt_EncryptData($sData, $sUserKey, $CALG_AES_256),1)




; #INDEX# ========================================================================
; Title .........: GUI_Configure.au3
; AutoIt Version : 3.3.14.2++
; Language ......: Italian
; Description ...: A collection of Function for Logic of Gest
; Author ........: Faustf
; What do you do.: Write data in File
; Version .......: 0.0.1 BETA - Work in progress 15/03/2016
; Syntax ........:
; ================================================================================

Func _True_write_File($sFilePath, $sDataWrite, $iReturn = 0)
    If $iReturn = Default Then $iReturn = 0

    $file = FileOpen($sFilePath, 1)
    If $iReturn = 0 Then
        FileWrite($file, $sDataWrite & @CRLF)
    Else
        FileWrite($file, $sDataWrite)
    EndIf
    FileClose($file)

EndFunc   ;==>_True_write_File

 

Link to comment
Share on other sites

I dont got/know this UDF. I cant help you on it. I am sure someone will reply.

But lol why use an udf to filewrite.

When you got FileWrite ? In your case it is useless.

 

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

so not  work also with classical file open file write file close .

i use my udf  simply because  why use 3 instruction  for do some things  when you can use only one  ? when you write big program you simplify a  code with them :)

Link to comment
Share on other sites

i understund what happen  if  i remove a file 

@ScriptDir & "\keypress.txt"

and  create with my udf or  your file open filewrite file close , the program go 

if i  open cancel and recreate  or simply open  with notepad after creation , not  go 

Link to comment
Share on other sites

Comon man. ;p

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

What error you got ?

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

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...