【发布时间】:2010-05-06 01:46:57
【问题描述】:
我正在构建一个需要修改配置文件的应用程序。
我的问题是我无法逐行读取文件。我一直把整个文件当作一个字符串。
string ConfigTemplate = AEBuildsSPFolderName + "\\Template_BuildReleaseScript.Config";
string[] fileSourceLines = File.ReadAllLines(ConfigTemplate, Encoding.Default);
//Returns the entire file contents into the first array element.
using (StreamReader reader = new StreamReader(ConfigTemplate))
{
string line;
while ((line = reader.ReadLine()) != null)
//Returns the entire file contents into the first line read.
知道我做错了什么吗?
谢谢,
大卫
【问题讨论】: