netapi32.dll and windows 98 ? (VB.NET)
-
windows 9x/NT does not support netapi32.dll. can anyone let me know on how to use netserverenum on these OSs or should i use any other api. Kindly help. Thanks in advance. :zzz:
-
windows 9x/NT does not support netapi32.dll. can anyone let me know on how to use netserverenum on these OSs or should i use any other api. Kindly help. Thanks in advance. :zzz:
NetServerEnum()
is supported on NT, from 3.1 and later. Unfortunately, you cannot use it on 9x. NetServerEnum reference[^] -- ian
-
NetServerEnum()
is supported on NT, from 3.1 and later. Unfortunately, you cannot use it on 9x. NetServerEnum reference[^] -- ian
well that's absolutely right. So is there anything that i can do to find the list of SQl servers in the network on these OSs. Thanks.
-
well that's absolutely right. So is there anything that i can do to find the list of SQl servers in the network on these OSs. Thanks.
You could try opening up a TCP/IP Socket on the standard SQL Server port (1433) on each machine you find to see if you can connect...or try to open a named pipe to the machine ("\\.\pipe\sql\query" or "\\.\pipe\MSSQL$instancename\sql\query")...if they succeed, it's probably an SQL server ;o)
"The greatest danger to humanity is humanity without an open mind."
- Ian Mariano
http://www.ian-space.com/ -
windows 9x/NT does not support netapi32.dll. can anyone let me know on how to use netserverenum on these OSs or should i use any other api. Kindly help. Thanks in advance. :zzz:
Yes, there is a way to Enumerate Servers on Win9x. However, I can't get the Code I have to work just right in VB.NET. If someone out there can help on this it would be great!!! The only thing it does is it keeps recusing the Top-Level Network Node (i.e. "Microsoft Windows Network" for me). Here's what I have so far: :~
'Declarations 'API Declarations Private Declare Auto Function GlobalAlloc Lib "kernel32" (ByVal wFlags As Integer, ByVal dwBytes As Integer) As Integer Private Declare Auto Function GlobalFree Lib "kernel32" (ByVal hMem As Integer) As Integer 'API Declarations for Win9x Private Declare Ansi Function WNetOpenEnum Lib "mpr.dll" Alias "WNetOpenEnumA" (ByVal dwScope As Integer, ByVal dwType As Integer, ByVal dwUsage As Integer, ByRef lpNetResource As IntPtr, ByRef lphEnum As Integer) As Integer Private Declare Ansi Function WNetEnumResource Lib "mpr.dll" Alias "WNetEnumResourceA" (ByVal hEnum As Integer, ByRef lpcCount As Integer, ByVal lpBuffer As Integer, ByRef lpBufferSize As Integer) As Integer Private Declare Ansi Function WNetCloseEnum Lib "mpr.dll" (ByVal hEnum As Integer) As Integer 'Structures _ Private Structure NETRESOURCE Dim Scope As Integer Dim Type As Integer Dim DisplayType As Integer Dim Usage As Integer Dim LocalName As IntPtr Dim RemoteName As IntPtr Dim Comment As IntPtr Dim Provider As IntPtr End Structure 'Constants for WNetEnum Private Enum ResourceScopes resConnected = &H1 'All currently connected resources (the dwUsage parameter is ignored) resGlobalNet = &H2 'All resources on the network. resRemembered = &H3 'All remembered (persistent) connections (dwUsage is ignored) resRecent = &H4 resContext = &H5 End Enum Private Enum ResourceTypes resAny = &H0 'All resources (this value cannot be combined with RESOURCETYPE_DISK or RESOURCETYPE_PRINT). resDisk = &H1 'All disk resources. resPrinter = &H2 'All print resources. resReserved = &H8 resUnknown = &HFFFF End Enum Private Enum ResourceUseages 'Ignored if the ResourceScope is not 'resGlobalNet' resAll = ((&H1) Or (&H2)) resConnectable = &H1 resContainer = &H2 resNoLocalDevice = &H4 resSibling = &H8 resReserved = &H80000000 End Enum Private Enum ResourceDisplayTypes 'Used to Determine the Resource Type of the NETRESOURCE Struct resGeneric = &H0 resDomain = &H1 resServer = &H2 resShare = &H3 r