Ok Well, in vb6 it's completely easy.

For an example, im trying to convert this to vb.net but im kinda struggling.

For Example, i don't know what the new get and put statements are in vb.net.

Dim aS As String
Dim aF As String
Open App.Path & "\s.exe" For Binary #1
aS = Space(LOF(1))
Get #1, , aS
Close #1

And in my view of conversion is

Dim aS As String
Dim aF As String
 FileOpen(1, "\s.exe", OpenMode.Binary, OpenAccess.ReadWrite)
       aS = Space(LOF(1))
            FileGet(1, aS)
            FileClose(1)

NOTE: THen of course i forgot to add the put statements so the bytes and data would be able to be written into the file. I forgot to add it, and too lazy to add it -.-'. So if anyone knows how i can use the "put" statements in vb.net along with "get" statements.


So if anyone have any information or ideas please share.

Dim swFile As System.IO.StreamWriter
swFile = System.IO.File.CreateText("c:\myfile.txt")
swFile.Write("MyText")
swFile.Close()

Dim srFile As System.IO.StreamReader
Dim sTextRead As String
srFile = System.IO.File.OpenText("c:\myfile.txt")
sTextRead = srFile.Read()
Debug.Print(sTextRead)
srFile.Close()

This is not exactly what you want, but it will give you an idea.

ps: if someone see's that there is better code or my code is not correct or lack please point to it because I am still learning :)

hth
Samir Ibrahim

Bleh, not exactly what iwas looking for but thanks for your effort!

This article has been dead for over six months. Start a new discussion instead.