0

I don't know if it is possible to do this in Windows Console Application (C#) but I really need something like this for my project.

I would like to send a string (or URL link) to the IE and have IE execute that string. However, since this string is static; what it does is just turn a machine ON and OFF via internet. So, in this case I have no interest in seeing the IE to popup/display nor the black screen console to appears when the application got executed.

I know in Console Application C# we can do something like this

        Process.Start("iexplore.exe", @"http://myserver.com");

However, when I run the above line, the IE popup and so does the black screen console.

Is there a way to not have IE popup and the screen console to not popup, too?

Thanks.

2 Answers 2

2

I think you are going about this the wrong way. IE is merely a portal to web requests. Just make the web request call directly. using something like the new Web API or HttpWebRequest

As to making the console not pop up, maybe you should be creating a Windows Service instead of a console application? We would need more details on the end user. If this is more of an automated action, then a service would work. If it is something the user clicks on, then why is displaying the console a bad thing? Typically, when you click on something you expect some sort of visual representation. But, here is a SO that answers this question already

Sign up to request clarification or add additional context in comments.

Comments

0

Try ProcessStartInfo. This will hide the console app, but I'm not positive about it hiding IE.

ProcessStartInfo psi = new ProcessStartInfo("iexplore.exe", @"http://myserver.com");
psi.WindowStyle = ProcessWindowStyle.Hidden;

Process.Start(psi);

2 Comments

hi I am currently using http request, now, this does pop of the console screen. I really want to hide this screen.
// prepare the web page we will be asking for HttpWebRequest request = (HttpWebRequest) WebRequest.Create("myserver.com"); // execute the request HttpWebResponse response = (HttpWebResponse) request.GetResponse();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.