private int IsMuma(string FullPath, int sleep) { if (sleep > 0) { Thread.Sleep(sleep); } try { if (FObject.IsExist(FullPath, FsoMethod.File)) { string sContent = FObject.ReadFile(FullPath); if (sContent.IndexOf("System.IO") > -1 || sContent.IndexOf("FileSystemObject") > -1) { return(1); } else if (sContent.IndexOf("<iframe") > -1) { return(2); } } } catch (Exception e) { Utils.WriteLog(string.Format("文件读取发生错误:{0},错误信息:{1}", FullPath, e.Message)); //throw; } return(0); }
private void AddScanFileToList(string filepath) { string sContent = FObject.ReadFile(filepath); if (sContent.IndexOf(FindKey) > -1) { ListViewItem lvi = new ListViewItem(); lvi.SubItems[0].Text = filepath; lvi.SubItems.Add("未替换"); lstFiles.Items.Add(lvi); //Amib.Threading.IWorkItemResult wir = ThreadPoolManager.Instance.QueueWorkItem(new Amib.Threading.WorkItemCallback(ToReplace), lvi); } }