public void saveToRegistry(String m_hostname)
{
Microsoft.Win32.RegistryKey cu = Microsoft.Win32.Registry.CurrentUser;
Microsoft.Win32.RegistryKey f5Key = cu.CreateSubKey(ACCOUNTS_KEY + "\\" + m_hostname);
if (null != f5Key)
{
f5Key.SetValue("Hostname", m_hostname);
f5Key.SetValue("Port", m_port);
f5Key.SetValue("Username", m_username);
if (null != m_proxy)
{
f5Key.SetValue("UseProxy", true);
f5Key.SetValue("ProxyHost", m_proxy.Address.Host);
f5Key.SetValue("ProxyPort", m_proxy.Address.Port.ToString());
if (null != m_proxy.Credentials)
{
f5Key.SetValue("ProxyUser", ((System.Net.NetworkCredential)m_proxy.Credentials).UserName);
}
}
}
f5Key.Close();
setLastAccount(m_hostname);
}