Пример #1
0
        internal static int GetDataPaths(IMSAdminBase iisAdmin, string searchPath, MBIdentifier propertyID, MBDataType dataType, ref List <string> paths)
        {
            int num  = 4096;
            int num2 = 0;

            char[] array;
            int    dataPaths;

            do
            {
                array     = new char[num];
                dataPaths = iisAdmin.GetDataPaths(SafeMetadataHandle.MetadataMasterRootHandle, searchPath, propertyID, dataType, num, array, out num);
            }while (dataPaths == -2147024774 && num2 < 5);
            if (dataPaths == -2147024774 && num2 == 5)
            {
                throw new IMSAdminHelperGetDataPathsCouldNotAllocateException();
            }
            if (dataPaths == -2147024888)
            {
                throw new OutOfMemoryException();
            }
            if (dataPaths < 0)
            {
                return(dataPaths);
            }
            int num3 = 0;

            while (array[num3] != '\0')
            {
                int num4 = num3;
                while (array[num4] != '\0')
                {
                    num4++;
                }
                int num5 = num4 - num3;
                while (num5 > 1 && array[num3 + num5 - 1] == '/')
                {
                    num5--;
                }
                paths.Add(new string(array, num3, num5));
                num3 = num4 + 1;
            }
            return(0);
        }
Пример #2
0
        internal static int GetDataPaths(string searchPath, MBIdentifier propertyID, MBDataType dataType, ref List <string> paths)
        {
            IMSAdminBase iisAdmin = IMSAdminBaseHelper.Create();

            return(IMSAdminBaseHelper.GetDataPaths(iisAdmin, searchPath, propertyID, dataType, ref paths));
        }