Hii
In a notepad file we have username=abc; password=abc
but I want passoword to be encrypted.
ui path must fetch this password and encrypt it and ten decrypt and enter into the website login credentials
-
use Read Text file to read Text from notepad file and store it in a string variable.
-
Then apply String manipulation functions or regular expression to fetch password from that String.
-
check below thread to convert String to secure string and then pass it to Type Secure text Activity to type password.
It will read password from split text file and encrypt it and then will write into split1 text file. Please find the attached file for your reference.
thanks, can we edit in the same file
username=abc
password=123a
isencrypted=false
if this is the content in notepad.
make it true once it is encrypted
if(isencrypted=“false”)…this condition not working, always taking to else condition
System.Text.RegularExpressions.Regex.Match(read,“(?<=(isencrypted=)).*”).Value
by the way where you are using this “key” -->“passwordEncryptKey”
where it is used?
After reading the text from text file and you are storing it in a string variable.
Then check below in IF condition
IF textOutput.Contains(“false”) then do encrypt text.
textOutput.replace("false’,“true”) - To replace false with true.
Thanks,
now it is encrypting
now not updating in the same file
Have you used this method to replace the text. After this, again you have to write this output into text file by using Write Text activity. Then only it will update.
ya I did,
false to true is replaced but not encrypted pwd
I have uploaded the file check it
Here, you used Write Text activity two times.
First time it wrote encrypted text and then again you are updating status. That time it will override the previous content.
To overcome this issue, use Append Line activity instead of Write Text activity.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.