Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2011-03-14
3
Medium Priority
?
309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Assisted Solution

by:Rahul Agarwal
Rahul Agarwal earned 600 total points
ID: 35135174
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
ID: 35135236
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 1400 total points
ID: 35137054
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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
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.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

636 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