LogPreProcess
来源:互联网 发布:巫妖王之怒cg知乎 编辑:程序博客网 时间:2024/06/08 13:55
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text;
namespace LogPreProcess
{
class Program
{
public static bool isOpen = true;
public static void Write(string path,string content)
{
FileStream fs = new FileStream(path, FileMode.Create);
StreamWriter sw = new StreamWriter(fs);
sw.Write(content);
sw.Flush();
sw.Close();
fs.Close();
}
public static void Read(string path)
{
StreamReader sr = new StreamReader(path, Encoding.Default);
String line;
StringBuilder strBuilder = new StringBuilder();
while ((line = sr.ReadLine()) != null)
{
//Console.WriteLine(line.ToString());
if (line.Contains("[S"))
{
isOpen = false;
continue;
}
else if (line.Contains("[R"))
{
isOpen = true;
}
if (isOpen)
{
strBuilder.Append(line);
strBuilder.Append("\r\n");
}
}
string content = strBuilder.ToString();
Write(path+".txt", content);
}
static void Main(string[] args)
{
Read(args[0]);
}
}
}
- LogPreProcess
- iOS导入三方框架出现"Unknown type name 'NSString'"错误
- ArrayList转换类型为DataTable类型
- excel中vlookup中的开头字母匹配
- 同花顺C++笔试
- jQuery的ajaxStart方法和ajaxStop方法
- LogPreProcess
- lightingpool 解决SDE无法连接的问题
- svnadmin dump and load
- VBOX中的Ubuntu的安装和配置
- C# 上传文件并生成缩略图
- HDOJ 2055 An easy problem
- Android Signed APK
- Windows Server 2012 R2 部署 Exchange 2013
- iOS9 新的通讯录框架