Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than netapi32, prefix the name with the module name and a period.
NetShareCheck (netapi32)
.
C# Signature:
[DllImport("netapi32.dll", SetLastError=true)]
static extern uint NetShareCheck(
[MarshalAs(UnmanagedType.LPWStr)] string servername,
[MarshalAs(UnmanagedType.LPWStr)] string device,
out SHARE_TYPE type
);
VB Signature:
Declare Function NetShareCheck Lib "netapi32.dll" (TODO) As TODO
servername: String that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
device: String that specifies the name of the device to check for shared access. Drive letter must be upper case.
type: Specify the type of the shared device. This parameter is set only if the function returns successfully.
C# Sample Code:
String server = "myServer"; // could be empty for local computer
String localPath = @"C:\shared folder";
SHARE_TYPE shareType;
Boolean exists;
NetError result = (NetError)NetShareCheck(server, localPath, out shareType);
switch (result)
{
case NetError.NERR_Success: exists = true;
break;
case NetError.ERROR_NOT_ENOUGH_MEMORY: throw new OutOfMemoryException();
case NetError.DeviceNotShared: exists = false;
break;
}
VB Sample Code:
Please add some!
The Netbios function interprets and executes the specified network control block (NCB). The Netbios function is provided primarily for applications that were written for the NetBIOS interface and need to be ported to Windows. Applications not requiring compatibility with NetBIOS should use other interfaces, such as mailslots, named pipes, RPC, or distributed COM to accomplish tasks similar to those supported by NetBIOS. These other interfaces are more flexible and portable.
5/23/2014 9:41:50 AM - jonr@reedholm.com-71.114.254.154
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).