How to use NetServerEnum from NetApi32.dll

BlitzMax Forums/BlitzMax Beginners Area/How to use NetServerEnum from NetApi32.dll

Ked(Posted 2007) [#1]
Can someone show me how to retrieve all the LAN computer names on a network using NetServerEnum from the NetApi32.dll? Here is where I saw information about it, but I don't understand C.

http://www.codeproject.com/KB/IP/ListNetworkComputers.aspx


grable(Posted 2007) [#2]
I ported the C# example over to blitzmax, but i dont get any machines listed. Maybe youl have better luck?




Ked(Posted 2007) [#3]
Thanks grable!

It works, but only returns the first letter of each computer name.


grable(Posted 2007) [#4]
Hmm.. try replacing the FromCString() on this line with a FromWString(), it might be unicode.

list[i] = String.FromCString( Byte Ptr Int Ptr(tmp)[1])


I get nothing on the list, so i am unable to test it further, sorry :(


Ked(Posted 2007) [#5]
That did it!

Thanks!


grable(Posted 2007) [#6]
No problem dude, glad it worked for you =)