private void DisconnectFromShare(string remoteUnc)
        {
            int num = NetworkShareAccesser.WNetCancelConnection2(remoteUnc, 1, false);

            this.Result = "";
            if (num != 0)
            {
                this.Result = this.getErrorForNumber(num);
            }
        }
        private void ConnectToShare(string remoteUnc, string username, string password, bool promptUser)
        {
            NetworkShareAccesser.NETRESOURCE lpNetResource = new NetworkShareAccesser.NETRESOURCE
            {
                dwType       = 1,
                lpRemoteName = remoteUnc
            };
            int num;

            if (promptUser)
            {
                num = NetworkShareAccesser.WNetUseConnection(IntPtr.Zero, lpNetResource, "", "", 24, null, null, null);
            }
            else
            {
                num = NetworkShareAccesser.WNetUseConnection(IntPtr.Zero, lpNetResource, password, username, 0, null, null, null);
            }
            if (num != 0)
            {
                this.Result = this.getErrorForNumber(num);
                return;
            }
            this.Result = "";
        }