Hello,
I'm trying to copy a complex structure to a string, encrypt the string, and then write the string to a file.
I've tried using the marshal class, but can't get anything to work. When I read the string in from the file, and try to copy the string to the structure to work with it, I get mangled data. Here's the string value:
"62510312006Blah11Blah 10312006123-321 dbname1 dbhost1 301FalseFalseFalseFalseFalsejbritt 032 10/30/2006 12:45:39 PM"
And the structure that I'm trying to use:
<StructLayout(LayoutKind.Sequential, pack:=0)> _
Public Structure TLIC
Dim DBID As Integer * 20
Dim CUSTNAME As String
Dim PASSWORD As Integer
Dim DISK1 As String * 9
Public dbName As String
<VBFixedString(75), System.Runtime.InteropServices.MarshalAs(System.Ru ntime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=75)> Public DBHOST As String
Dim MaxUsers As Short
Dim Nag As Short
Dim DEMO As Boolean
Dim SINGLE_Renamed As Boolean
Dim REPONLY As Boolean
Dim INSECURE As Boolean
Dim WEB As Boolean
<VBFixedString(20), System.Runtime.InteropServices.MarshalAs(System.Ru ntime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=20)> Public REPNAME As String
Dim BFUTURE1 As Byte
Dim BFUTURE2 As Byte
<VBFixedString(20), System.Runtime.InteropServices.MarshalAs(System.Ru ntime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=20)> Public SFUTURE1 As String
<VBFixedString(20), System.Runtime.InteropServices.MarshalAs(System.Ru ntime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=20)> Public SFUTURE2 As String
Dim CREATEDATE As Date
End Structure