When you try to access remote server, network redirector tries to get the
address of the server. It issues DNS query. This process takes a while...
AFAIK there can be several solutions:
- if you know the IP address of the server, try to connect to it on 135-139
( for UNC )
- if you know the IP substitue it into the UNC path.
- if you do not know the IP try to resolve it manually using Dns.Resolve (
..NET 1.0 - 1.1 )
or GetHostEntry ( .NET 2.0 )
--
Vadym Stetsyak aka Vadmyst
http://vadmyst.blogspot.com
"css" <id************@forgetit.com> wrote in message
news:96**********************************@microsof t.com...
When I call Directory.Exists for a UNC path like below...
if (Directory.Exists(@\\SomeServer\C) == false)
{
....
}
and that server does not exist on the connected network, it takes around a
minute to return from the call which properly returns false.
Is there a faster way to determine if a directory or server exists on the
network?