Exemplo n.º 1
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        string projcode = Context.Request.Params["ProjectCode"];
//        string photosPath = Context.Request.FilePath + Path.DirectorySeparatorChar;
        string           mappedPhotosDbPath = Context.Request.MapPath("") + "\\photos";
        DirectoryBrowser dirBrowser         = new DirectoryBrowser(mappedPhotosDbPath, "");

        if (dirBrowser.RootPathExist(TextBox1.Text.Trim()))
        {
            Label1.Text = "目录名已存在,请换个名字输入";
        }
        else
        {
            if (dirBrowser.CreateRootDirectorie(projcode, TextBox1.Text.Trim()))
            {
                EnterAlbum(TextBox1.Text.Trim());
            }
            else
            {
                Label1.Text = "创建目录失败,请重试或通知管理员";
            }
        }
    }