The subject of my post is pretty much my question. In vb6 is "file" different in any way from the vb.net "GetFile"?
Also Form_Load event was upgraded to Form_Load method. Any difference there?
Thank you!
*** UPDATE ***
To put it another way, here is code that is vb6 that I want to convert to vb.net:
Private Sub Command1_Click(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles Command1.Click
Dim u As Object
cd1Open.ShowDialog()
If Strings.Len(cd1Open.FileName) = 0 Then Exit Sub
FileSystem.FileOpen(1, cd1Open.FileName, OpenMode.Binary)
ReDim FDATA(FileSystem.LOF(1) - 1)
FileSystem.FileGet(1, FDATA, -1)
FileSystem.FileClose(1)
If ReadPE(FDATA) = 0 Then
MessageBox.Show("File is not Win32 Executeable!", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error) : Exit Sub
End If
Private Sub Form_Load()
Top = (Screen.PrimaryScreen.Bounds.Height - Height) / 2
Left = (Screen.PrimaryScreen.Bounds.Width - Width) / 2
End Sub
Also, I am having problems with this bit of code...
Public Function ReadPE(ByRef DATA() As Byte) As Byte
On Error GoTo ErrX
Dim CNT As Integer
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(DOSHEADER, DATA(CNT), CShort(Marshal.SizeOf(DOSHEADER)))
If DOSHEADER.e_magic.Value <> "MZ" Then Exit Function
UpgradeSolution1Support.SafeNative.kernel32.CopyMemory(NTHEADER, DATA(DOSHEADER.e_lfanew), CShort(Marshal.SizeOf(NTHEADER)))
CNT = CNT + DOSHEADER.e_lfanew + Marshal.SizeOf(NTHEADER)
If NTHEADER.Signature.Value <> "PE" & Strings.Chr(0).ToString() & Strings.Chr(0).ToString() Then Exit Function
ReDim SECTIONSHEADER(NTHEADER.FileHeader.NumberOfSections - 1)
For Each SECTIONSHEADER_item As IMAGE_SECTION_HEADER In SECTIONSHEADER
CNT += Marshal.SizeOf(SECTIONSHEADER(0))
Next SECTIONSHEADER_item
Return 1
ErrX:
On Error GoTo 0
End Function
Any suggestion will be greatly appreciated as how to convert this to vb.net.
[Edit - added code from comments]