cyclonebri
Regular
Hey Everybody,
Hopefully this is an easy one but I can't seem to find the answer through search, so I apologize in advance if this has already been posted.
A simple problem. I have a string that I want to iterate by character, converting each character to it's ascii representation.
I was wondering how I can accomplish this without making a table with the values and just finding them...my goal is to mask a plain text password stored in an XML file for later retrieval (since we don't use the registry anymore). Basically the user logs in and I want the ability to remember their settings like a cookie would do on a web page, but this is a desktop app.
I have all the code I need, except the ability to convert an unknown character (variable tmpChar) to it's ascii representation.
I do this:
for (int i = 0; i<mPassword.Length; i++)
{
tmpStr = mPassword.Substring(i,1);
tmpChar = Convert.ToChar(tmpStr);
//convert to ascii
//tmpInt = SomeConvertFunction(tmpChar);
//if I have to I could write a function but I'd rather not do that
}
Thanks in advance for any help!
Brian
Hopefully this is an easy one but I can't seem to find the answer through search, so I apologize in advance if this has already been posted.
A simple problem. I have a string that I want to iterate by character, converting each character to it's ascii representation.
I was wondering how I can accomplish this without making a table with the values and just finding them...my goal is to mask a plain text password stored in an XML file for later retrieval (since we don't use the registry anymore). Basically the user logs in and I want the ability to remember their settings like a cookie would do on a web page, but this is a desktop app.
I have all the code I need, except the ability to convert an unknown character (variable tmpChar) to it's ascii representation.
I do this:
for (int i = 0; i<mPassword.Length; i++)
{
tmpStr = mPassword.Substring(i,1);
tmpChar = Convert.ToChar(tmpStr);
//convert to ascii
//tmpInt = SomeConvertFunction(tmpChar);
//if I have to I could write a function but I'd rather not do that
}
Thanks in advance for any help!
Brian