从WPF中的“资源文件夹"中打开文件
我正在制作一个应用程序,以从应用程序的资源目录中打开文件,当我在线发布该文件时,该文件将包含在项目中,
它不会安装在开始"菜单中,而是一个独立的应用程序,
在按钮上,单击我要打开包含在资源文件夹中的文件.
我到目前为止所拥有的是:
Hi,
I am making a application to open files from the resource directory of the application which would be included with the project when i publish it online,
It would not install in start menu and would be a standalone application,
On a Button Click i want to open a file which i have included in the resource folder.
what i have so far is:
private void button1_Click_2(object sender, RoutedEventArgs e)
{
string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\test.txt";
if (File.Exists(path))
{
Process.Start(new ProcessStartInfo(path));
}
else
{
MessageBox.Show("No file found"+path);
}
但是当我单击它时,它指向我未包含在项目中的bin \ debug文件夹.
我已经在线设置了我的项目以进行测试,
http://setup.fastfixsupport.net/publish.htm
有人可以帮我吗?
But when i click it it points to bin\debug folder which i am not including in the project.
I have setup my project online for test at
http://setup.fastfixsupport.net/publish.htm
Can anyone help me with this ?