Abstractions.WindowsApi.pInvokes.DisconnectNetworkDrive C# (CSharp) 메소드

DisconnectNetworkDrive() 공개 정적인 메소드

disconnecting an UNC share
public static DisconnectNetworkDrive ( string remoteUNC ) : System.Boolean
remoteUNC string
리턴 System.Boolean
        public static Boolean DisconnectNetworkDrive(string remoteUNC)
        {
            int ret = SafeNativeMethods.WNetCancelConnection2(remoteUNC, SafeNativeMethods.Connect.CONNECT_UPDATE_PROFILE, false);
            if ((ret != 0) && (ret != 2250/*This network connection does not exist*/))
            {
                LibraryLogging.Error("Unable to disConnect from {0} Error:{1} {2}", remoteUNC, ret, LastError());
                return false;
            }

            return true;
        }