public XTextInfo(string path, string keyword) { this.Picture = XImage.LoadImagebyExt(path); this.name = XPath.GetFileNameWithoutExtension(path); this.path = path; this.keyword = keyword; // this.lineresult = XTxt.GetLineHaveKeyWord(path, keyword); }
void AddFileToListBox(string path) { XInfo listitem = new XInfo(XImage.LoadImagebyExt(path), XPath.GetFileNameWithoutExtension(path), path); listBox_timkiem.Invoke((Action)(() => { listBox_timkiem.BeginUpdate(); listBox_timkiem.Items.Add(listitem); listBox_timkiem.EndUpdate(); })); }
//so sánh tên file trong path vs nhiều từ public static bool IsEqualName(string path, string[] keyword) { bool check = false; //chuyển tất cả kí tự về kí tự thường //lấy ra từng đuôi một để so sánh for (int i = 0; i < keyword.Length; i++) { //keyword[i] = XTxt.RemoveSign4VietnameseString(keyword[i]); //if (XTxt.RemoveSign4VietnameseString(XPath.GetFileNameWithoutExtension(path)).IndexOf(keyword[i], StringComparison.CurrentCultureIgnoreCase)>=0) return true;// nếu tm 1 đuôi trong chỗ đuỗi thi thoát if (XPath.GetFileNameWithoutExtension(path).IndexOf(keyword[i], StringComparison.CurrentCultureIgnoreCase) >= 0) { return(true); // nếu tm 1 đuôi trong chỗ đuỗi thi thoát } } return(check); }
//so sánh tên file trong path vs từ search public static bool IsEqualName(string path, string search) { //search = XTxt.RemoveSign4VietnameseString(search); return(XPath.GetFileNameWithoutExtension(path).IndexOf(search, StringComparison.CurrentCultureIgnoreCase) >= 0); //return XTxt.RemoveSign4VietnameseString(XPath.GetFileNameWithoutExtension(path)).IndexOf(search,StringComparison.CurrentCultureIgnoreCase) >= 0; }
public XInfo(string path) { Picture = XImage.LoadImagebyExt(path); Name = XPath.GetFileNameWithoutExtension(path); this.Path = path; }
//Move folder ở sourfolder sang địa chỉ destPath static public void MoveFolderTo(string sourceFolder, string destPath) { string destFolder = destPath + "\\" + XPath.GetFileNameWithoutExtension(sourceFolder); MoveFolder(sourceFolder, destFolder); }