Static string NetShareGetPath(string serverName, string netName) / Retrieves the local path for the given server and share name.
string netname, int level, ref IntPtr bufptr) Static extern int NetShareGetInfo( string servername, Static extern int NetApiBufferFree(IntPtr Buffer) Specify a large enough buffer to receive all entries.' Ĭase ERROR_NOT_ENOUGH_MEMORY: return 'Insufficient memory is available.' Ĭase NERR_BufTooSmall: return 'The supplied buffer is too small.' Ĭase NERR_NetNameNotFound: return 'The share name does not exist.' My intention is to find out if a folder has been shared with a particular user.Ĭase ERROR_ACCESS_DENIED: return 'The user does not have access to the requested information.' Ĭase ERROR_INVALID_LEVEL: return 'The value specified for the level parameter is invalid.' Ĭase ERROR_INVALID_PARAMETER: return 'The specified parameter is invalid.' Ĭase ERROR_MORE_DATA: return 'More entries are available.
However, I cannot figure out a way to pass the user name and password. I tried out the following code to get a pointer to the SHARE_INFO_2 structure.