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)

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.

Recommended Answers

All 3 Replies

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

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

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 :)

Samir Ibrahim

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


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.