best way to check my local area network is up and running

  • Thread starter Thread starter cj
  • Start date Start date
C

cj

How would you suggest I test that my network drive is still up and
running. Right now I'm going to write to a file at the root of the
drive and then read it back in. If either the write or read fail I
figure the network is down. Any better ideas?
 
why dont you just try checking if the directory exists...for instance

''if drive is mapped
if (System.IO.Directory.Exists("F:\"))
MsgBox("Connected!")
end if

''if not mapped
if (System.IO.Directory.Exists("\\SomePathHere\Directory"))
MsgBox("Connected!")
end if


hope this helps
 
I'd just reccomend not running windows.. and not relying on .NET

things are so much easier when you use a reliable file server
and when you use a programming language that doesn't shove 'Visual
Fred' up your ass HALFWAY

MS is just a bunch of halfwits
they don't know how to sell a polished product

and meanwhile they're taking your money and playing xbox
 
How would you suggest I test that my network drive is still up and
running. Right now I'm going to write to a file at the root of the
drive and then read it back in. If either the write or read fail I
figure the network is down. Any better ideas?

You could just ping the server to see if it is available, or possible
a System.IO.Directory.Exists(...) check on the network folder could
tell you.

Thanks,

Seth Rowe
 
cj said:
How would you suggest I test that my network drive is still up and
running. Right now I'm going to write to a file at the root of the
drive and then read it back in. If either the write or read fail I
figure the network is down. Any better ideas?

If you use the My.Computer.Network.Ping you'll be able to ping the machine
you want to use to see if it responds. If it doesn't you could maybe start a
timer to ping the machine at intervals until it comes up.

Just a thought.
 
Back
Top