Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Know Server Type?
Message
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00171182
Message ID:
00171230
Views:
28
>I have a VFP6 app running, and was wondering if there is a way
>through code to know if the workstation (95/NT) is accessing
>a Netware or NT or Linux server through code without a 3rd
>party add-on.

The API call NetServerGetInfo() can return a SERVER_INFO_101 structure; the sv101_type member of the structure gives you sufficient information to id the server type, and the operating system version is identified in the sv101_version_major and sv101_version_minor members.

The API call is declared as:
DECLARE INTEGER NetServerGetInfo IN NETAPI32.DLL ;
   STRING servername, ;
   INTEGER level, ;
   STRING bufptr
You need to preallocate the buffer, and it really should be allocated and released with the NetAPI buffer API calls. Pass 101 as the value for level to get back the SERVER_INFO_101 structure. No special privileges are needed to make the call.

Under Win95, use SVRAPI.DLL instead of NETAPI32.DLL
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