Solved

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

Posted on 2011-03-14
3
258 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
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 350 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

911 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

24 Experts available now in Live!

Get 1:1 Help Now