I m trying to use filestream to get a *.exe file from my resources. my code is this: filerdr = New FileStream(My.Resources.ResourceManager.GetStream("filename.exe"), FileMode.Open)
but i get this error with it
Overload resolution failed because no accessible 'New' can be called with these arguments: 'Public Sub New(handle As Microsoft.Win32.SafeHandles.SafeFileHandle, access As System.IO.FileAccess)': Value of type 'System.IO.UnmanagedMemoryStream' cannot be converted to 'Microsoft.Win32.SafeHandles.SafeFileHandle'. 'Public Sub New(handle As System.IntPtr, access As System.IO.FileAccess)': Value of type 'System.IO.UnmanagedMemoryStream' cannot be converted to 'System.IntPtr'. 'Public Sub New(path As String, mode As System.IO.FileMode)': Value of type 'System.IO.UnmanagedMemoryStream' cannot be converted to 'String'.
I have also tried: filerdr = New FileStream(My.Resources.filename.exe, FileMode.Open
but still no luck, please don't give me work arounds and please tell me how to do this the way i want to do it.
I want to add FileMode.Open and then compare it to another file, by using
If filerdr.ReadByte = filerdr2.ReadByte AndAlso
filerdr.Length = filerdr2.Length Then
''''''''''''
End If
My.Resources.ResourceManager.GetStream("filename.exe")already return you a stream? You don't need aFileStream.FileStream?GetStreamreturns a stream - are you saying you cant read from it?