skitz
Member
- Joined
- May 8, 2009
- Messages
- 15
- Programming Experience
- Beginner
Read is not a member of byte array
ok im tryin to run an embedded .exe in my app but i seem to be having a issue with my code can someone have a look and tell me what my issue is ?
my error is ' Read ' is not a member of 'system Array'. i have change the program name to Myprogram i have added myprogram.exe and then the 'exe' is not a member of 'system array' am i doing something compleatly wrong i have had help with the code so far as im only a beginner
ok im tryin to run an embedded .exe in my app but i seem to be having a issue with my code can someone have a look and tell me what my issue is ?
VB.NET:
Private Sub ButtonX1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonX1.Click
Dim size As Long = My.Resources.Myprogram.Length - 1
Dim buffer(CInt(size)) As Byte
Dim offset As Integer = 0
Dim count As Integer = CInt(size)
Dim returnValue As Integer
[U] returnValue = My.Resources.Myprogram.Read(buffer, offset, count)[/U]
Dim fs As New] IO.FileStream(IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Temp, "Myprogram.exe"), IO.FileMode.Create)
fs.Write(buffer, 0, buffer.Length)
fs.Close()
End Sub
my error is ' Read ' is not a member of 'system Array'. i have change the program name to Myprogram i have added myprogram.exe and then the 'exe' is not a member of 'system array' am i doing something compleatly wrong i have had help with the code so far as im only a beginner