' Replace all End Of Line Delimiters with CRLF
Dim newfile As New System.IO.StreamReader(CopySource & System.IO.Path.GetFileName(file))
Dim data As String
data = newfile.ReadToEnd()
data = data.Replace(vbCrLf, vbLf)
data = data.Replace(vbCr, vbLf)
data = data.Replace(vbLf, vbCrLf)
newfile.Close()
Dim writer As New System.IO.StreamWriter(CopySource & System.IO.Path.GetFileName(file), False)
writer.Write(data)
writer.Flush()
writer.Close()在每一行的结束处使用CRLF
最新推荐文章于 2024-10-09 16:46:46 发布
本文介绍如何使用VB.NET代码将文件中的所有换行符替换为CRLF(即
),确保文件在不同操作系统之间兼容。
588

被折叠的 条评论
为什么被折叠?



