Ejemplo n.º 1
0
        /// <summary>
        /// Check if the path is a folder on an Alfresco CIFS server
        /// </summary>
        /// <returns>(bool) true=valid folder</returns>
        private bool IsAlfrescoFolder()
        {
            // Check if the handle is valid, if not then the path is not valid
            if (m_handle == INVALID_HANDLE_VALUE)
            {
                return(false);
            }

            // Send a special I/O control to the Alfresco share to check that it is an Alfresco CIFS server
            ioctlAlfrescoProbe alfrescoProbeStruct = new ioctlAlfrescoProbe();
            bool alfFolder = false;

            try
            {
                // Copy output string into generic object
                object objOutput = alfrescoProbeStruct;
                // Check if the remote server is an Alfresco CIFS server
                uint len = SendIOControl(FSConstants.FSCTL_ALFRESCO_PROBE, ref objOutput, (uint)Marshal.SizeOf(alfrescoProbeStruct));

                alfFolder = true;
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.Print(e.Message);
            }

            // If the folder is not an Alfresco CIFS folder then close the folder
            if (!alfFolder)
            {
                CloseHandle(m_handle);
                m_handle = INVALID_HANDLE_VALUE;
            }

            // Return the folder status
            return(alfFolder);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Check if the path is a folder on an Alfresco CIFS server
        /// </summary>
        /// <returns>(bool) true=valid folder</returns>
        private bool IsAlfrescoFolder()
        {
            // Check if the handle is valid, if not then the path is not valid
             if (m_handle == INVALID_HANDLE_VALUE)
             {
            return false;
             }

             // Send a special I/O control to the Alfresco share to check that it is an Alfresco CIFS server
             ioctlAlfrescoProbe alfrescoProbeStruct = new ioctlAlfrescoProbe();
             bool alfFolder = false;

             try
             {
            // Copy output string into generic object
            object objOutput = alfrescoProbeStruct;
            // Check if the remote server is an Alfresco CIFS server
            uint len = SendIOControl(FSConstants.FSCTL_ALFRESCO_PROBE, ref objOutput, (uint)Marshal.SizeOf(alfrescoProbeStruct));

            alfFolder = true;
             }
             catch (Exception e)
             {
            System.Diagnostics.Debug.Print(e.Message);
             }

             // If the folder is not an Alfresco CIFS folder then close the folder
             if (!alfFolder)
             {
            CloseHandle(m_handle);
            m_handle = INVALID_HANDLE_VALUE;
             }

             // Return the folder status
             return alfFolder;
        }