Exemplo n.º 1
0
        public Folder creatNewFolder(Folder afolder, string num, string name1, string name2, string prefixname, string postfixname)
        {
            string apath = afolder.getpath();

            int length = afolder.getLength();

            String[] newname;
            newname = new string[length];
            if (num != "")
            {
                int anum = Convert.ToInt32(num);
                for (int i = 0; i < length; i++)
                {
                    newname[i] = apath + "\\" + prefixname + name1 + anum.ToString() + postfixname + "." + name2;
                    anum++;
                }
            }
            if (num == "")
            {
                for (int i = 0; i < length; i++)
                {
                    newname[i] = apath + "\\" + prefixname + name1 + postfixname + "." + name2;
                }
            }

            Folder newfolder = new Folder(newname);

            return(newfolder);
        }
Exemplo n.º 2
0
        public Folder creatNewFolder(Folder afolder, string num, string name1, string name2,string prefixname,string postfixname)
        {
            string apath = afolder.getpath() ;

            int length = afolder.getLength();
            String[] newname ;
            newname = new string[length];
            if (num != "")
            {
                int anum = Convert.ToInt32(num);
                for (int i = 0; i < length; i++)
                {
                    newname[i] = apath + "\\" + prefixname + name1 + anum.ToString() + postfixname + "." + name2;
                    anum++;
                }
            }
            if (num == "")
            {
                for (int i = 0; i < length; i++)
                {
                    newname[i] = apath + "\\" + prefixname + name1 + postfixname + "." + name2;
                }
            }

            Folder newfolder = new Folder(newname);
            return newfolder;
        }
Exemplo n.º 3
0
 private void buttonSave_Click(object sender, EventArgs e)
 {
     if (mainfunction.wheSave(folder1, folder2, numBox.Text, textBox1.Text, ExtensionBox.Text))
     {
         mainfunction.reName(folder1, folder2);
         mainfunction.openFolder(folder1.getpath());
     }
 }
Exemplo n.º 4
0
 public void TestFolder()
 {
     String[] s = {"C:\\test\\abc2.c","C:\\test\\abc3.c","C:\\test\\we2.png"};
     var folder = new Folder(s);
      //   Assert.AreEqual();
     Assert.AreEqual(folder.getExpName(),"c");
     Assert.AreEqual(folder.getFirstFileName(), "abc2");
     Assert.AreEqual(folder.getLength(),3);
     Assert.AreEqual(folder.getName(), "C:\\test\\abc2.c");
     Assert.AreEqual(folder.getpath(),"C:\\test");
 }