Hi Gideon,
Are you just assuming that certain computers on the LAN might not be available
at times or are there good reasons for computer's to be offline? Are you just
concerned with network instability?
The network should probably be stable and configured properly so that all
computers are "available" at all times.
Showing the users that the computers are "available" may not help them if they
should always be available anyway. Also, it's possible that your method of
detection may show the computer as available until your application attempts
an operation that requires a connection to the remote computer, in which case
it fails and leaves the user wondering why your program said that it wouldn't
fail.
Also realize that most users would probably like to try the operation
themselves, even if your program states that the computer is probably offline.
From the information you've supplied it sounds to me like you shouldn't notify
the users of a computer's availability in the list and just assume that it
will be available at all times. If an attempted operation fails, you may want
to alert the user that the computer may be offline and to try again later.
Then, you may want to show an offline icon in the list next to the computer
name, but this shouldn't prevent your program from attempting the operation
again when the user demands it. If a subsequent attempt succeeds, you can
remove the offline icon.
This way the user decides when your program should try the operation, keeping
the user in control. And if they don't have that ability and somehow "fix"
the offline problem themselves, they'll have to wait for your program to
update the display before they can try again.
If you have a good reason for certain computers to be unavailable at times and
you think it would be better to absolutely prevent users from attempting an
operation on a remote computer that your program assumes will fail, then
you'll have to use a timer to periodically check the computer's availability
and update your display. The easiest and most light-weight approach to
determining whether a computer is online, IMO, is the Ping class. You can use
the System.Timers.Timer class in code to raise a periodic, synchronized event
at the interval you specify.
HTH
--
Dave Sexton
"giddy" <gi*******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.com...
HI ,
i'm making an application for a simple hotel , theres no network
administrator , and the people who are going to use my software are
simple accoutants or data enterers! lol
anyway... i' think i'll use directory.Exists() to see if the path to
the pc is valid and then chaning the lisview's picture! basically if is
it unavailiable i want to remove/Disable some of the context menu
options!
i looked a little into pinging and active directory , i might use them
later on!
thanks for your help!
Gideon
Dave Sexton wrote:
>You should speak to the network administrator to see if there is a common
port
open or share accessible on every computer on the network, or if every
computer can be configured to respond to Ping requests, for example.
>If you can't find some common check point amongst all computers on the
network
then you might find that the list you are trying to provide in your program
may not be a good representation of whether the computers are reachable or
not, and so might not be much help to the user.