コード例 #1
0
        private void button4_Click(object sender, EventArgs e)
        {
            fGetPath f = new fGetPath("Rename");

            f.ShowDialog();
            string newname = f.newpath;

            if (newname != null)
            {
                if (System.IO.File.GetAttributes(path).HasFlag(System.IO.FileAttributes.Directory))
                {
                    XFolder.RenameFolder(path, newname);
                }
                else
                {
                    XFile.CopyTo(path, newname);
                }
            }
            this.Close();
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            fGetPath f = new fGetPath("Xuly");

            f.ShowDialog();
            string newpath = f.newpath;

            if (newpath != null)
            {
                if (System.IO.File.GetAttributes(path).HasFlag(System.IO.FileAttributes.Directory))
                {
                    XFolder.MoveFolderTo(path, newpath);
                }
                else
                {
                    XFile.MoveTo(path, newpath);
                }
            }
            this.Close();
        }