A
Andrew van der Stock
Hi there,
I'm getting some bizarre results.
I'm using Visual Studio 2003 Enterprise Edition, with Managed C++.
I try the following:
(server is a string).
if ( server )
{
try {
IPHostEntry *he = Dns::Resolve(server);
// we only care about the first A record in the DNS
if ( he->AddressList->Count > 0 )
host = IPAddress:arse(he->AddressList->Item[0]->ToString());
}
catch (System::ArgumentNullException *ex)
( every single exception type is detailed after that )
However, running this through line by line, Dns::Resolve *always* regardless of server's contents, or even if I use Dns::Resolve(S"www.microsoft.com"), *always* comes up with 127.0.0.1 in the host entry. Obviously, this is useless to me. I've also tried using GetHostbyName() with similar results.
Clues gratefully received.
Andrew
I'm getting some bizarre results.
I'm using Visual Studio 2003 Enterprise Edition, with Managed C++.
I try the following:
(server is a string).
if ( server )
{
try {
IPHostEntry *he = Dns::Resolve(server);
// we only care about the first A record in the DNS
if ( he->AddressList->Count > 0 )
host = IPAddress:arse(he->AddressList->Item[0]->ToString());
}
catch (System::ArgumentNullException *ex)
( every single exception type is detailed after that )
However, running this through line by line, Dns::Resolve *always* regardless of server's contents, or even if I use Dns::Resolve(S"www.microsoft.com"), *always* comes up with 127.0.0.1 in the host entry. Obviously, this is useless to me. I've also tried using GetHostbyName() with similar results.
Clues gratefully received.
Andrew