1

I have 2 projects here under the same solution for C#.net Let's called it project1 and project2. I have project1 been open. When I click on a button on project1, it will go then to project2.

//using this code
var project2= new project2();
project2.Show();
this.Hide();

But I still did not manage to do it. Can anybody suggest what should I do?

Raktim Biswas
  • 4,011
  • 5
  • 27
  • 32
Muhammad Saifullah
  • 87
  • 1
  • 3
  • 15

1 Answers1

1
string exePath = @"C:\Project2\bin\Debug\Project2.exe";// Your exe path
Process.Start(exePath);
this.Hide();

I check your version too and it also works

 private void button1_Click(object sender, EventArgs e)
 {
     Project2.Form1 f = new Project2.Form1();
     f.Show();
     this.Hide();
 };
Narek Arzumanyan
  • 616
  • 3
  • 11
  • even though I manage to get it run, but the system is running under my username as Im putting my system at C:\....Users\ComputerName\ is there a way for me to change the way the code read my system as if I want to share it with my friends? Thank you – Muhammad Saifullah Aug 08 '16 at 08:23
  • `http://weblogs.asp.net/hernandl/startprocessasuser http://stackoverflow.com/questions/4624113/start-a-net-process-as-a-different-user` i hop that this halps you – Narek Arzumanyan Aug 08 '16 at 08:50
  • Thank you for the info, it does help. Awesome share. – Muhammad Saifullah Aug 08 '16 at 10:09