private void txtLog_DragEnter(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { e.Effect = DragDropEffects.Copy; } else { e.Effect = DragDropEffects.None; } } private string MainLog = string.Empty; private void txtLog_DragDrop(object sender, DragEventArgs e) { txtLog.Clear(); String[] files = e.Data.GetData(DataFormats.FileDrop, false) as String[]; //Copy file from external application foreach (string srcfile in files) { var log = File.ReadAllText(srcfile); string checkLog = ReadLog(log); txtLog.Text += checkLog; } SetColor(); }
编辑器加载中...