예제 #1
0
        private string ServerMapFolder(string resourceType, string folderPath)
        {
            string path = Path.Combine(base.UserFilesDirectory, resourceType);

            PEUtil.CreateDirectory(path);
            return(Path.Combine(path, folderPath.TrimStart(new char[] { '/' })));
        }
예제 #2
0
        private void CreateFolder(XmlNode connectorNode, string resourceType, string currentFolder)
        {
            string attributeValue = "0";
            string str2           = base.Request.QueryString["NewFolderName"];

            if ((str2 == null) || (str2.Length == 0))
            {
                attributeValue = "102";
            }
            else
            {
                string str3 = this.ServerMapFolder(resourceType, currentFolder);
                try
                {
                    PEUtil.CreateDirectory(Path.Combine(str3, str2));
                }
                catch (ArgumentException)
                {
                    attributeValue = "102";
                }
                catch (PathTooLongException)
                {
                    attributeValue = "102";
                }
                catch (IOException)
                {
                    attributeValue = "101";
                }
                catch (SecurityException)
                {
                    attributeValue = "103";
                }
                catch (Exception)
                {
                    attributeValue = "110";
                }
            }
            XmlUtil.SetAttribute(XmlUtil.AppendElement(connectorNode, "Error"), "number", attributeValue);
        }