我正在构建一个需要修改配置文件的应用程序。
我的问题是我无法逐行读取文件。我一直把整个文件作为一个字符串。
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.
Run Code Online (Sandbox Code Playgroud)
知道我做错了什么吗?
谢谢,
大卫