??? about firewalled environment ???
-
I wrote a program needs to connect to remote servers, my problem is - my program throw an exception when i try to connect from firewalled or proxy environment. the question is: How can i import IE settings to my program? OR "at least":sigh: How can i the proxy settings in my program? please help me with a piece of code or at least ClassName please reply...
-
I wrote a program needs to connect to remote servers, my problem is - my program throw an exception when i try to connect from firewalled or proxy environment. the question is: How can i import IE settings to my program? OR "at least":sigh: How can i the proxy settings in my program? please help me with a piece of code or at least ClassName please reply...
Well, as far as getting the proxy settings from IE -- You can grab the ProxyServer value from HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer (REG_SZ); how you use this depends on what you're connecting to obviously...
RegistryKey key = Registry.CurrentUser; key = key.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings"); Console.WriteLine(key.GetValue("ProxyServer"));
-- modified at 7:07 Monday 16th October, 2006 -
Well, as far as getting the proxy settings from IE -- You can grab the ProxyServer value from HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer (REG_SZ); how you use this depends on what you're connecting to obviously...
RegistryKey key = Registry.CurrentUser; key = key.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings"); Console.WriteLine(key.GetValue("ProxyServer"));
-- modified at 7:07 Monday 16th October, 2006Thanx, but i still can not establish a connection becuase i cannot use that value or where i can use it in my connection //establish TCP connection try { CallTrace(" Connect at port {0}", port); serverTcpConnection = new TcpClient(popServer, port); } catch (Exception ex) { throw new Pop3Exception("Connection to server "+ popServer + ", port " + port + " failed.\nRuntime Error: "+ex.ToString()); }