0

What i want to achieve is this: I have a solution with 3 projects inside. I've added these projects to the explorer folder, solution explorer and made a reference from projectA to projectB & projectC.

Now what I want is this, when I click a button on a form of projectA (the first project the user sees when he opens the EXE) like this:

     private void projectbButton_Click(object sender, EventArgs e)
    {
        this.Hide();
        projectB.form1 li = new  projectB.form1 ();         
        li.Show();
    }

that projectB form opens up.

This works but then the problem is that my other project is just hidden. Now is it possible to add something here that my projectA is fully closed and my projectB starts indepently. So that all the paths etc that are declared in my projectB forms like this:

    inputStream = File.OpenText("gevaar17.txt");

are still valid. (because now I get a filenotfoundexeption since it's looking in the debug folder of projectA). And that when I search for a textfile in projectB form1 for example it doesn't go looking in projectA/bin/debug folder for the textfile. But that it goes looking in the debug folder of projectB?

thanks in advance.

user3644837
  • 335
  • 2
  • 3
  • 8

1 Answers1

0
private void projectbButton_Click(object sender, EventArgs e)
    {
        Process.Start("Project2.exe");
        Application.Exit();
    }

This will start the other project in a completely independent environment and the paths will work. Also, Process.Start() returns Process which you can use to do something if you want, just a tip. Add this to the usings:

using System.Diagnostics;
Asad Ali
  • 684
  • 6
  • 17