【发布时间】:2020-07-23 06:37:11
【问题描述】:
在使用 '\n' 将字符串拆分为行之后,当您已经在检查当前行时,如何获得下一行中的内容?现在这就是我在 .net 中使用的内容:
WebClient Downloadurl = new WebClient();
byte[] myDataBuffer = Downloadurl.DownloadData(url);
string download = Encoding.ASCII.GetString(myDataBuffer);
String newfile = download.Replace("<br>", "\n");
String path = @"E:\BI\projet\dotnet2.csv";
try
{
Create the file, or overwrite if the file exists.
using (FileStream fs = File.Create(path))
{
byte[] info = new UTF8Encoding(true).GetBytes(newfile);
fs.Write(info,0,info.Length);
}
【问题讨论】: