I am trying to get a list of shares on a specific machine. So I decided to use the Windows API NetApi32.dll. Here is my code snippet:
Dim svr As String = Environment.MachineName
Dim level As Integer = 2
Dim sharesRead As Integer, totalEntries As Integer, nRet As Integer, hResume As Integer = 0
Dim pBuffer As IntPtr = IntPtr.Zero
nRet = NetApi32.NetShareEnum(svr, level, pBuffer, -1, sharesRead, totalEntries, hResume)
I'm getting a return code of 1231, but can't seem to find what that equates to. Can anyone point me in the correct direction on how to do this if it an incorrect way?