Я пытаюсь использовать filestream для получения * .exe-файла из моих ресурсов. мой код это: filerdr = New FileStream(My.Resources.ResourceManager.GetStream("filename.exe"), FileMode.Open)
, но я получаю эту ошибку с этимИспользовать filestream для чтения файла из ресурсов
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
Не 'My.Resources.ResourceManager.GetStream (" filename.exe ")' уже возвращает вам поток? Вам не нужен «FileStream». –
Я хочу добавить FileMode.Open. а затем сравните его с другим файлом, используя . Если filerdr.ReadByte = filerdr2.ReadByte AndAlso filerdr.Length = filerdr2.Length Затем '' '' '' '' '' '' End If –
Какая часть этого может быть вы не обойдетесь без использования «FileStream»? –