我有同样的问题,Niphoet在堆栈溢出问题Overwrite a specific line in a text file using VB.NET。 我想实现的是Axarydax显示,在C#中,我试图转换到使用到VB.NET代码。我的问题是,代码会让我的新的文本文件,但它不会写任何从另一个文本文件,它的线条,只是留下空白。我想我的问题是与while循环语句,但我不能肯定。以下是我迄今为止: P
Public Sub WriteTextFile(ByVal SourceToWrite As String, ByVal LocationToWrite As String)
Dim file As System.IO.StreamWriter
IO.File.Delete(LocationToWrite)
file = My.Computer.FileSystem
我正在尝试使用流编写器写入某些文本文件。 我正在尝试编写的文本来自不同的文本文件。 我尝试: string line = reader.ReadLine(); //reader is a streamReader I defined before
while (line != null)
{
sw.WriteLine(line); //sw is a streamWriter I d