[DllImport("Netapi32.dll", CharSet=CharSet.Auto, SetLastError=true)]
static extern int NetDfsAdd(
[MarshalAs(UnmanagedType.LPWStr)]
string DfsEntryPath,
[MarshalAs(UnmanagedType.LPWStr)]
string ServerName,
[MarshalAs(UnmanagedType.LPWStr)]
string PathName,
[MarshalAs(UnmanagedType.LPWStr)]
string Comment,
int Flags);
Declare Function NetDfsAdd Lib "netapi32.dll" (TODO) As TODO
None.
None.
Please add some!
// DFS_ADD_VOLUME has a value of 1 - see MSDN docs
NetDfsAdd("\\DfsRoot\Path\Dir", "FileServer", "Share", "Comment", 1);
Do you know one? Please contribute it!
Also on MSDN, there is a more detailed example of using this API: