Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
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:

C#
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);
    }

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 ?
Posted

1 solution

 
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