我正在尝试使用文件流从我的资源中获取 *.exe 文件。我的代码是这样的:filerdr = New FileStream(My.Resources.ResourceManager.GetStream("filename.exe"), FileMode.Open)
但我得到了这个错误
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'.
我也试过:filerdr = New FileStream(My.Resources.filename.exe, FileMode.Open
但仍然没有运气,请不要给我解决方法,请告诉我如何按照我想要的方式执行此操作。
我想添加FileMode.Open
然后将其与另一个文件进行比较,通过使用
If filerdr.ReadByte = filerdr2.ReadByte AndAlso
filerdr.Length = filerdr2.Length Then
''''''''''''
End If