我正在尝试获取特定机器上的共享列表。所以我决定使用 Windows API NetApi32.dll。这是我的代码片段:
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)
我收到了 1231 的返回码,但似乎找不到它的含义。如果方法不正确,谁能指出我如何做到这一点的正确方向?