using System.Runtime.InteropServices; namespace FontPreview; internal static class NetApi { [DllImport("mpr.dll", CharSet = CharSet.Unicode)] internal static extern int WNetAddConnection2(ref NETRESOURCE netResource, string password, string username, int flags); [DllImport("mpr.dll", CharSet = CharSet.Unicode)] internal static extern int WNetCancelConnection2(string name, int flags, bool force); }