如何从recources运行exe文件 [英] How to run exe file from recources

查看:88
本文介绍了如何从recources运行exe文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我这样做:

Dim ParentDirectory As String = System.IO.Directory.GetParent(System.Windows.Forms.Application.StartupPath).FullName
    Dim ProgramPath As String = ParentDirectory & "\resources\MyApp.exe" 
    System.Diagnostics.Process.Start(ProgramPath)

现在这不再帮助我了,因为Recources文件夹不是bin文件夹中的子文件夹,它是与bin相同的文件夹中的文件夹。那么我该怎样做才能通过替换它来到那个目录?

Now this ain't helping me anymore because the Recources folder isn't a subfolder in bin folder, it is a folder located in the same folder as bin. So what can i do to go to that directory by replacing this?

Dim ParentDirectory As String = System.IO.Directory.GetParent(System.Windows.Forms.Application.StartupPath).FullName
    

推荐答案

资源是程序集的一部分。 

Resources is a part of the assembly. 

因此它可以是 

Therefore it can be 

System.Diagnostics.Process.Start(My.Resources.ProgramPath)

设置你使用它,你带有项目属性,然后选择资源

To set it you use this, where you come with project properties and then select resources


这篇关于如何从recources运行exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆