Author: SimonRigby | Posted on: 2/5/2009 7:23:50 AM | Views : 296

Hi folks,
I have a simple little file manager that I'm developing as part of our CMS. It uses AJAX calls to an asmx web service to perform various folder and file operations like Get Folders, GetFiles etc. I have one method RenameFolder which simply does a Directory.Move() as below.
[WebMethod]
    [ScriptMethod]
    public void RenameFolder(string path, string newName) {

        string rootPath = path.Substring(0, path.LastIndexOf("/") + 1);
        try
        {
            Directory.Move(Server.MapPath(path), Server.MapPath(rootPath + newName));
        } catch (Exception ex)
        {
            Debug.WriteLine(ex.Message);
 &n ...

Go to the complete details ...