C# - NetUseAdd from NetApi32.dll on Windows Server 2008 and IIS7
- by Jack Ryan
I am attemping to use NetUseAdd to add a share that is needed by an application. My code looks like this.
[DllImport("NetApi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
internal static extern uint NetUseAdd(
string UncServerName,
uint Level,
IntPtr Buf,
out uint ParmError);
...
USE_INFO_2 info = new…