Groups | Blog | Home
all groups > vb.net upgrade > august 2004 >

vb.net upgrade : NetShareGetInfo API Call


ralph.mallamace NO[at]SPAM alphawest.com.au
8/24/2004 6:32:57 PM
Hi All,

I've posted this to various other VB newsgroups and haven't got any
responses, so I hope there are some intelligent people here who
actually have an idea in this area.

I've been trying to get the API NetShareGetInfo running in VB.NET.
Does anyone have any working examples of getting this to work?

I am using the following declaration which I don't even know if it is
correct, but I also need an example of how to use this call this as
well as I have tried Strings, Char Arrays, everything I can think of
but there is always errors.

Declare Auto Function NetShareGetInfo Lib "NETAPI32" ( _
ByRef ServerName As String, _
ByRef NetName As String, _
ByVal Level As Integer, _
ByRef Buffer As IntPtr _
) As Integer

Patrick Steele [MVP]
9/2/2004 1:06:39 PM
In article <5d7f62d8.0408241732.622761a5@posting.google.com>,
ralph.mallamace@alphawest.com.au says...
[quoted text, click to view]

Try http://www.pinvoke.net

--
Patrick Steele
Microsoft .NET MVP
Ralph Mallamace
9/2/2004 6:23:47 PM
Hi Patrick,

I've already looked at http://www.pinvoke.net and no one seems to update
these API's with decent examples. I finally worked out how to do a
NetShareGetInfo API call in VB.NET myself from looking at VB 6 code and
various other API calls and finally stumbled across a solution that
seems to work. Its probably not the best solution, buts its a solution
that seems to work - and since I just updated pinvoke with it its
probably the only one available for VB.NET on the internet at the
moment.

Cheers

Ralph

*** Sent via Developersdex http://www.developersdex.com ***
AddThis Social Bookmark Button