So, I'm working on converting this code from VB.NET to C#:
Public Class Form1
Const filesplit As String = "|split|"
Dim stub, opt() As String
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
On Error Resume Next
FileOpen(1, Application.ExecutablePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
stub = Space(LOF(1))
FileGet(1, stub)
FileClose(1)
opt = Split(stub, filesplit)
End Sub
End Class
I've used a series of online converters, and they don't really work for me.
How do I do it? I'm trying to understand VB.NET source code so I can use it in.
FileOpen()? (AndSpace()? AndLOF()? AndFileGet()? AndFileClose()? AndSplit()?) If this is VB .NET then you have some helper functions that you either need to examine and implement or move to a separate assembly and reference them as-is. Either way, all of the file operations you would need are in theSystem.IOnamespace.On Errorstatement still works in VB.NET).