for (int i = 1; i < listBox1.Items.Count; i++)
{
RegistryKey reg = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
reg.SetValue("ProxyEnable", 1);
reg.SetValue("ProxyServer", listBox1.SelectedItems[i]);
}