Jump to content

Recommended Posts

Posted

Hi,

I am trying to read a string from an INI file. I sucessfully read the string but certain characters are stripped out automatically by AutoIT. See the following example.

INI File looks like this:

[Keys]

Key1 = "xxx-xxx-xxx-GVZF"

Key2 = "PGxpY2Vuc2VwYWNrZXQ+PGxpveD48L2xpY2Vuc2VwYWNrZXQ+"

Dim $strKey1

Dim $strKey2

;#Tried this first

$strKey2 = IniRead("g:\a_disk_backup\comp-lic.ini", "Keys", "Key2", "")

$strKey1 = IniRead("g:\a_disk_backup\comp-lic.ini", "Keys", "Key1", "")

;#Tried this second does not change the stripped output.

$strKey2 = String(IniRead("g:\a_disk_backup\comp-lic.ini", "Keys", "Key2", ""))

;#some windowing code.

Send($strKey2)

;#some windowing code.

Send($strKey1)

Strings Returned look like this:

Key 2

PGxpY2Vuc2VwYWNrZXQPGxpveD48L2xpY2Vuc2VwYWNrZXQ

Key 1

xxx-xxx-xxx-GVZF <======= this one is fine

It should look like this:

Key 2

PGxpY2Vuc2VwYWNrZXQ+PGxpveD48L2xpY2Vuc2VwYWNrZXQ+

Key 1

xxx-xxx-xxx-GVZF <========== this one is fine

Note: The '+' characters are stripped out......

Any help would be appreciated.

Jim.

  • Moderators
Posted

Try taking the quotes out and using Send($var, 1)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Posted (edited)

I don't have the some problem, beta or release.

I've set up a test.ini and a test.au3

test.ini :

[Keys]

Key = "PGxpY2Vuc2VwYWNrZXQ+PGxpveD48L2xpY2Vuc2VwYWNrZXQ+"

test.au3 :

MsgBox(0, "", IniRead("test.ini", "Keys", "Key", ""))

Edited by Manadar
Posted

Try taking the quotes out and using Send($var, 1)

the flag on the send($var,1) did it. quotes did not matter.....

Man! I thought it was the read function........ Sorry for acting like a noob!

Thank you very much!

Jim.

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
×
×
  • Create New...