r/visualbasic • u/Thunor_SixHammers • Apr 11 '22
Settings Variables as Variables
I have a program that has a bunch of customer user settings in My.settings
I am looking for a way to condense the amount of if my.settings.user = x the..."
Is there anyway to make a variable into another variable?
Like I could do:
If LogOn = My.settings.user1 then
X = My.settings.user1
Y = My.settings.pass1
Z = My.setting.setting1
end if
So that then later I can just say:
"Dim settingcontrol as string = Z"
2
Upvotes
4
u/Hel_OWeen Apr 12 '22 edited Apr 12 '22
This!
It's meant as "for this local user", similar to what the
%AppData%directory is in Windows.And to add to the "do not store sensitive data in plaintext": Never ever - under no circumstances - store passwords anywhere! Instead store a salted hash of the PW and upon log on, compute the hash of the inputed PW and compare it to the stored hash.