class Program
{
static void Main(string[] args)
{
//通过StreamReader和StreamWriter对工资文件进行操作
//读取工资文件,把文件中的工资翻倍并写入到另一个文件中--- 练习
///读
using (StreamReader reader = new StreamReader("gz.txt", Encoding.Default))
{
//写
using (StreamWriter writer = new StreamWriter("gz1.txt", false, Encoding.Default))
{
string line;
while ((line = reader.ReadLine()) != null)
{
//把每一行的|切掉
string[] salary = line.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
//writer.Write();
string txt = string.Format("{0}{1}", salary[0], Convert.ToInt32(salary[1]) * 2);
writer.WriteLine(txt);
}//end while
}//end using
}//end using
Console.WriteLine("就这样被你征服");
}
}