我在 Visual Basic 6 中编写了一些代码来反转文件的内容,但是我在将此代码转换为 .NET 时遇到问题,因为 VB.NET 仅读取文件的文本部分。有人可以给我看一下这段代码的 VB.NET 等价物吗?我相信它不仅会帮助我,还会帮助整个 SOF 社区:)。
Public Function NeutralizeFile(strFile As String, strOut As String) As Boolean
On Error GoTo ErrDelete
Dim File As String
Open strFile For Binary As #1
File = Space(LOF(1))
Get #1, , File
Close #1
File = StrReverse(File)
Open strOut For Binary As #1
Put #1, , File
Close #1
Kill strFile
ErrDelete:
End Function