WNetAddConnection3

[DllImport("Mpr.dll", SetLastError = true)]
public static extern uint WNetAddConnection3(
   IntPtr hwndOwner,
   ref NETRESOURCE lpNetResource,
   string lpPassword,
   string lpUserName,
   uint dwFlags
);

Microsoft documentation: Link

Last updated