Solved

I have a form that has a lot of buttons. In which want some actions.C#

Posted on 2011-03-14
3
246 Views
Last Modified: 2012-05-11
Hi,

I have a form that has a lot of buttons. In which want some actions.C#

1 I have figured out some but wanted to know when button clicked how can i get the ipconfig results displayed on a new form.
2. Open Explorer/IE/Firefox on 3 different button clicks

regards
Raja
0
Comment
Question by:bsharath
3 Comments
 
LVL 13

Assisted Solution

by:agarwalrahul
agarwalrahul earned 150 total points
Comment Utility
Please check the link for Ipconfig:

http://stackoverflow.com/questions/657225/how-to-create-command-application-like-run-command-for-vista

If you want to open page in IE - use this:

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = URI;
process.Start();
0
 
LVL 11

Author Comment

by:bsharath
Comment Utility
Thanks

System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = URI;
process.Start();

URI should i define anything
Cant we open the IE as from the system path directly when clicked?
0
 
LVL 15

Accepted Solution

by:
angus_young_acdc earned 350 total points
Comment Utility
Yes you will have to state what the URI is.   You can also specify what URL you want Internet Explorer and Firefox to navigate to.  Please see the attached examples.
string ie = @"C:\Program Files\Internet Explorer\iexplore.exe";
            string ff = @"C:\Program Files\Mozilla Firefox\firefox.exe";
            string explorerLocation = @"C:\";

            System.Diagnostics.Process openIEProcess = new System.Diagnostics.Process();
            openIEProcess.StartInfo.FileName = ie;
            openIEProcess.StartInfo.Arguments = "www.yahoo.com";
            openIEProcess.Start();

            System.Diagnostics.Process openFFProcess = new System.Diagnostics.Process();
            openFFProcess.StartInfo.FileName = ff;
            openIEProcess.StartInfo.Arguments = "www.yahoo.com";
            openFFProcess.Start();

Open in new window

0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now