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; }
public void reName(Folder folder1, Folder folder2) { for(int i = 0 ; i < folder1.getLength(); i++) { fileRename(folder1.myfile[i].getFileName(),folder2.myfile[i].getFileName()); } }
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); }
public void reName(Folder folder1, Folder folder2) { for (int i = 0; i < folder1.getLength(); i++) { fileRename(folder1.myfile[i].getFileName(), folder2.myfile[i].getFileName()); } }
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"); }
public bool wheSave(Folder mf1, Folder mf2, String s1, String s2, String s3) { if (mf2 == null) { return(false); } if (wheRename(mf1, s1, s2, s3) == false) { return(false); } if (mf1.getLength() != mf2.getLength()) { return(false); } return(true); }
private void listview(Folder afolder, ListView alistview) { alistview.Clear(); listView1.GridLines = true;//显示网格线 alistview.FullRowSelect = true; // alistview.View = View.Details; // alistview.Items.Add("file"); for (int i = 0; i < afolder.getLength(); i++) { alistview.Items.Add(afolder.myfile[i].getPreName() + "." + afolder.myfile[i].getExpandName()); // alistview.Items[i].SubItems.Add("." + afolder.myfile[i].getExpandName()); // ListViewItem alistViewItem = new ListViewItem(afolder.myfile[i].getPreName()); // alistViewItem.SubItems.Add(); // alistview.Columns.Add(afolder.myfile[i].getPreName(), 100); } // alistview.Items.Add(alistViewItem); // return alistview; }
public bool wheRename(Folder mf, String s1, String s2, String s3) { if (mf == null) { return(false); } if (mf.getLength() == 0) { return(false); } if (s1 == null) { return(false); } if (s2 == null) { return(false); } if (s3 == null) { return(false); } if (s1 == "") { return(false); } if (s2 == "") { return(false); } if (s3 == "") { return(false); } return(true); }
public bool wheRename(Folder mf, String s1, String s2, String s3) { if (mf == null) return false; if (mf.getLength() == 0) return false; if (s1 == null) return false; if (s2 == null) return false; if (s3 == null) return false; if (s1 == "") return false; if (s2 == "") return false; if (s3 == "") return false; return true; }
public bool wheSave(Folder mf1, Folder mf2, String s1, String s2, String s3) { if (mf2 == null) return false; if (wheRename(mf1, s1, s2, s3) == false) return false; if (mf1.getLength() != mf2.getLength()) return false; return true; }