G
Guest
Hi,
I need to send data from a file into a structure. In Vb6 this was done like
so.
public Type Struct1
v1 as string
v2 as string
end type
dim s1 as Struct1
Open TxtPath For Random Access Read Shared As #1 Len = Len(s1)
Get #1, , s1
Close #1
How can this be done in VB.NET?
I tried something like this, however I cant seem to be able to convert my
buffer to a structure.
Public Structure Struct1
<VBFixedString(4)>public v1 as string
<VBFixedString(4)>public v2 as string
End Structure
dim s1 as Struct1
dim oFs as new filestream....
Dim oBr As New BinaryReader(oFs)
Dim oBuf() As Char
ReDim oBuf(Len(s1))
oBr.Read(oBuf, 0, Len(s1))
At this point i don't know how to convert my buffer to a Struct1 object ...
Thx for any input.
I need to send data from a file into a structure. In Vb6 this was done like
so.
public Type Struct1
v1 as string
v2 as string
end type
dim s1 as Struct1
Open TxtPath For Random Access Read Shared As #1 Len = Len(s1)
Get #1, , s1
Close #1
How can this be done in VB.NET?
I tried something like this, however I cant seem to be able to convert my
buffer to a structure.
Public Structure Struct1
<VBFixedString(4)>public v1 as string
<VBFixedString(4)>public v2 as string
End Structure
dim s1 as Struct1
dim oFs as new filestream....
Dim oBr As New BinaryReader(oFs)
Dim oBuf() As Char
ReDim oBuf(Len(s1))
oBr.Read(oBuf, 0, Len(s1))
At this point i don't know how to convert my buffer to a Struct1 object ...
Thx for any input.