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

getDeviceInfo() public method

Function to retrieve device info from the registry
public getDeviceInfo ( ) : void
return void
        public void getDeviceInfo()
        {
            RegistryKey rkHKCU = Registry.CurrentUser;
            RegistryKey rkSettingsPath = null;

            try
            {
                rkSettingsPath = rkHKCU.CreateSubKey("Software\\BlackBerry\\BlackBerryVSPlugin");

                object pwd = rkSettingsPath.GetValue("device_password");
                if (pwd != null)
                    DevicePassword = GlobalFunctions.Decrypt(pwd.ToString());

                object ip = rkSettingsPath.GetValue("device_IP");
                if (ip != null)
                    DeviceIP = ip.ToString();
            }
            catch
            {

            }

            rkSettingsPath.Close();
            rkHKCU.Close();
        }

Usage Example

コード例 #1
0
        /// <summary>
        /// Settings Dialog Constructor
        /// </summary>
        public SettingsDialog()
        {
            InitializeComponent();

            _data = new SettingsData();
            gridMain.DataContext = _data;

            _data.getSimulatorInfo();
            _data.getDeviceInfo();
            tbDevicePassword.Password = _data.DevicePassword;
            tbSimulatorPassword.Password = _data.SimulatorPassword;
        }