Salve ragazzi sto cercando di sviluppare una patch in vb.net però mi restituisce questo errore!!! =( cosa ho sbagliato?
Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'String'. C:\Users\Francesco\AppData\Local\Temporary Projects\WindowsApplication1\Form1.vb 19 41 WindowsApplication1
Imports System.Reflection
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim path As String = My.Computer.FileSystem.SpecialDirectories.ProgramF iles & "\VirtualDJ" & "\amtlib.dll"
If IO.File.Exists(path) Then
MsgBox("Old File Found!")
Else
MsgBox("Path not found :" & " " & vbNewLine & _
My.Computer.FileSystem.SpecialDirectories.ProgramF iles & "\VirtualDJ")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
My.Computer.FileSystem.CopyFile(My.Resources.amtli b, "C:\b.jpeg")
End Sub
Imports System.Reflection
Imports System.IO
Module Module1
Public Sub SaveToDisk(ByVal resourceName As String, ByVal fileName As String)
' Get a reference to the running application.
Dim assy As [Assembly] = [Assembly].GetExecutingAssembly()
' Loop through each resource, looking for the image name (case-insensitive).
For Each resource As String In assy.GetManifestResourceNames()
If resource.ToLower().IndexOf(resourceName.ToLower) <> -1 Then
' Get the embedded file from the assembly as a MemoryStream.
Using resourceStream As System.IO.Stream = assy.GetManifestResourceStream(resource)
If resourceStream IsNot Nothing Then
Using reader As New BinaryReader(resourceStream)
' Read the bytes from the input stream.
Dim buffer() As Byte = reader.ReadBytes(CInt(resourceStream.Length))
Using outputStream As New FileStream(fileName, FileMode.Create)
Using writer As New BinaryWriter(outputStream)
' Write the bytes to the output stream.
writer.Write(buffer)
End Using
End Using
End Using
End If
End Using
Exit For
End If
Next resource
SaveToDisk("amtlib.dll", "C:\VirtualDJ\amtlib.dll")
End Sub
End Module

