Click here to Skip to main content
15,890,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: MCAD Pin
Mohamad Al Husseiny19-Aug-05 4:53
Mohamad Al Husseiny19-Aug-05 4:53 
GeneralDisplaying data from 2 Tables in one Grid Pin
zaboboa19-Aug-05 2:31
zaboboa19-Aug-05 2:31 
GeneralRe: Displaying data from 2 Tables in one Grid Pin
Azerax19-Aug-05 2:47
Azerax19-Aug-05 2:47 
GeneralPrint Option using Crystal Report Pin
Member 220793419-Aug-05 2:19
Member 220793419-Aug-05 2:19 
GeneralDiabling Close Button Pin
ivix4u19-Aug-05 2:04
ivix4u19-Aug-05 2:04 
GeneralRe: Diabling Close Button Pin
miah alom19-Aug-05 4:23
miah alom19-Aug-05 4:23 
GeneralCOMSVCS.dll Monitoring Com + Pin
Member 215122719-Aug-05 1:56
Member 215122719-Aug-05 1:56 
GeneralDNS Resolve Pin
keshavcn19-Aug-05 1:42
keshavcn19-Aug-05 1:42 
I've trying to get MX records for a domain using c#. Below given code (taken from MSDN) works fine for me, when having direct internet connection:
------------------------------------------------------------------------------
IPHostEntry hostInfo = Dns.Resolve(hostString);
// Get the IP address list that resolves to the host names contained in the
// Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
String[] alias = hostInfo.Aliases;

Console.WriteLine("Host name : " + hostInfo.HostName);
Console.WriteLine("\nAliases : ");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
}
Console.WriteLine("\nIP Address list :");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
------------------------------------------------------------------------------
However, the same piece of code fails to work when I'm connecting to Internet through a Proxy Server and Socks5 authentication. Below mentioned error was received:
------------------------------------------------------------------------------
The requested name is valid, but no data of the requested type was found
------------------------------------------------------------------------------

Since C# Sockets doesn't support proxy, I'm using socket class provided by mentalis.org. I'm able to connect to the Proxy server but when trying to connect to a domain such as yahoo.com on port number 53 (default) I'm receiving "General SOCKS server failure.". I wonder what might be causing this error.

Org.Mentalis.Network.ProxySocket.ProxySocket s = new Org.Mentalis.Network.ProxySocket.ProxySocket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
// set the proxy settings
s.ProxyEndPoint = new IPEndPoint(IPAddress.Parse("192.168.0.1"), 1090);
s.ProxyUser = "<username>";
s.ProxyPass = "<password>";
s.ProxyType = ProxyTypes.Socks5;
s.Connect("yahoo.com", 53);*** Immediately after this line I'm receiving this error.

If I try to connect to port number 80, then everything is working fine and I'm able to send & receive data.

Could anyone point out where I'm going wrong. Any help would be greatly appreciated. Thank You.

Keshav



keshavcn@yahoo.com
QuestionHow to pick up multiple resultsets from a query Pin
skooij19-Aug-05 1:30
skooij19-Aug-05 1:30 
AnswerRe: How to pick up multiple resultsets from a query Pin
Guffa19-Aug-05 2:17
Guffa19-Aug-05 2:17 
GeneralRe: How to pick up multiple resultsets from a query Pin
skooij19-Aug-05 2:27
skooij19-Aug-05 2:27 
GeneralRe: How to pick up multiple resultsets from a query Pin
Guffa19-Aug-05 2:43
Guffa19-Aug-05 2:43 
Generalimportant coding problem Pin
snouto19-Aug-05 0:53
snouto19-Aug-05 0:53 
GeneralRe: important coding problem Pin
Corinna John19-Aug-05 1:32
Corinna John19-Aug-05 1:32 
GeneralRe: important coding problem Pin
miah alom19-Aug-05 4:34
miah alom19-Aug-05 4:34 
GeneralRe: important coding problem Pin
Corinna John19-Aug-05 5:16
Corinna John19-Aug-05 5:16 
GeneralCancel closing a form Pin
bouli19-Aug-05 0:06
bouli19-Aug-05 0:06 
GeneralRe: Cancel closing a form Pin
Azerax19-Aug-05 1:05
Azerax19-Aug-05 1:05 
GeneralRe: Cancel closing a form Pin
bouli19-Aug-05 1:19
bouli19-Aug-05 1:19 
GeneralCannot get value because it is DBNull Pin
beqs18-Aug-05 23:47
beqs18-Aug-05 23:47 
GeneralRe: Cannot get value because it is DBNull Pin
Guffa18-Aug-05 23:53
Guffa18-Aug-05 23:53 
GeneralRe: Cannot get value because it is DBNull Pin
Anonymous19-Aug-05 0:39
Anonymous19-Aug-05 0:39 
GeneralRe: Cannot get value because it is DBNull Pin
Guffa19-Aug-05 0:51
Guffa19-Aug-05 0:51 
GeneralRe: Cannot get value because it is DBNull Pin
Anonymous19-Aug-05 1:31
Anonymous19-Aug-05 1:31 
GeneralRe: Cannot get value because it is DBNull Pin
Azerax19-Aug-05 0:50
Azerax19-Aug-05 0:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.