RIM.VSNDK_Package.Settings.Models.SettingsData.registerTargetInfo C# (CSharp) Method

registerTargetInfo() private method

Set the password and IP address into the correct registry keys for both simulator and device
private registerTargetInfo ( string password, string IP, string type ) : void
password string The password to encrypt and store.
IP string The IP Address to store.
type string The key location device or simulator.
return void
        private void registerTargetInfo(string password, string IP, string type)
        {
            RegistryKey rkHKCU = Registry.CurrentUser;
            RegistryKey rkTargetInfo = null;

            try
            {
                rkTargetInfo = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");
                if (password == null)
                    password = "";

                if (IP == null)
                    IP = "";

                rkTargetInfo.SetValue(type + "_password", GlobalFunctions.Encrypt(password));
                rkTargetInfo.SetValue(type + "_IP", IP);
            }
            catch
            {

            }
            finally
            {
                rkTargetInfo.Close();
                rkHKCU.Close();
            }
        }