Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connected to Network
Message
From
09/10/1998 13:20:52
 
 
To
09/10/1998 09:36:40
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00144975
Message ID:
00145479
Views:
34
>>>Anybody know a reliable way to determine if a workstation is connected to a network?
>>>
>>
>>Lots of ways; but it depends on what exactly you're trying to determine - for example, are you trying to see if the station is currently logged into any network, or a particular network, or if a particular network resource has been (or can be) attached, or if the station -can- log into a network (IOW if the necessary client software is present to operate on a network, even if not logged in presently), or something else?
>
>
>What I'm doing is creating a utility that shows files in use on a workstation or server. If the user is connected to a network, I want to show available servers, just like network neighborhood does. If not, I want to show the computer name.
>
>I'm thinking that I can use WNetEnumResource and if it returns an error code, assume that I'm not connected and show the computer name. If it doesn't, show the servers.
>

You might want to take a look at the Shell Automation object Shell.Application, using the BrowseForFolder() method, which can retrieve the names of computers anchored from the Network Neightborhood, and the Windows Scipting Host AUtomation object Wscript.Network
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform