如何将exe文件添加到资源文件夹

时间:2019-07-02 20:47:20

标签: vb.net

我对这段代码有疑问:程序找不到资源文件夹中的exe文件。

我搜索了很多,但什么都没找到。

Public Appfold As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & "\AppData\Roaming\BullSht"
Dim UserProfile As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Dim AppData As String = UserProfile & "\AppData\Roaming"
Dim Bin As String = AppData & "\BullSht"

Try
    If System.IO.File.Exists(Bin & "\AnyDesk.exe") = False Then
        IO.File.WriteAllBytes(Bin & "\AnyDesk.exe", My.Resources.Anydesk)
        If System.IO.File.Exists(Bin & "\AnyDesk.exe") = True Then
            Process.Start(Bin & "\AnyDesk.exe")
        End If
    End If
    If System.IO.File.Exists(Bin & "\AnyDesk.exe") = True Then
        Process.Start(Bin & "\AnyDesk.exe")
    End If
Catch ex As Exception
    MsgBox(ErrorToString, MsgBoxStyle.Critical)
End Try

问题出在My.Resource.Anydesk中,他们找不到该文件夹​​中的文件。

谢谢大家。

0 个答案:

没有答案