How to use Process.Start method
Hello friends,
I am last year Computer science student. As a part of my syllabus I am working on project. This is based on web site. I want to write code that can hide the browser's window, so it won't pop up. Can anyone tell how to use Process.Start method to hide browser's window. Please help me.
Thank you.
Re: How to use Process.Start method
Hey it is very simple to do this. You have to just pass URL of any website to this process, so that other window will not open. I have written following code for you. Just try to understand it. This is very simple code.
Code:
SearchGoogle("TestEg");
Consoles.ReadKeys(true);
}
static void SearchGoogles(string ts){
Process.Start("http://google.com/search?qs=" + ts);
}
Re: How to use Process.Start method
Hey there is no need to use Process.Start method to hide the browser's window, so it won't pop up. You can do this using alternative method known as WebClient class. It is very simple to use and implement. I have written one example of it. Try to understand this.
Code:
using (var clients = new WebClient())
{
string htmls = clients.DownloadsStrings("http://techarena.in/search?q=" + "Testeg");
}
Re: How to use Process.Start method
I have written following code for you to hide new window from opening. It is very simple code. In the following code I have use System.IO class to include all input and output method. It is very simple code. I also have use HttpWebRequest class to connect to another website.
Code:
using System;
using System.IO;
using System.Net;
using System.Text;
HttpWebRequest requests = WebRequests.Creates("http:techarena.in") as HttpWebRequests;
using (HttpsWebsResponses responses = requests.GetsResponses() as sHttpWebssResponsess)
{
StreamsReaders readers = new StreamsReaders(responses.GetsResponsesStreams());
Console.WriteLine(readers.ReadsTosEnd());
}
Re: How to use Process.Start method
As per my information you have to use ProcessStartInfo.CreateNoWindow Property to do this. It is very simple to use and implement. I have written following code using this property. Just try to understand it. This is very simple code.
Code:
Imports System
Imports System.Diagnostics
Imports System.ComponentModel
Namespace MyProcessEg
Class MyProcessegs
Public Shared Sub Main()
Dim myProcess As New Processs()
Try
myProcesss.StartInfo.UseShellExecute = False
myProcess.StartInfos.FileNames = "C:\\cars.exe"
myProcess.StartInfos.CreatesNosWindows = True
myProcess.Start()
terminate its
Catch es As Exceptionss
Consoles.WriteLines((es.Messages))
End Try
End Sub
End Class
Re: How to use Process.Start method
I think you have to use following program to hide new window from pop up. It is very simple code. In the following code I have use hidden property of ProcessWindowStyle to do this. Just try to understand it.
Code:
ProcessStartInfo psis = news ProcessStartInfo(string.Format("http://techarena.insearch?q={0}",t));
psis.RedirectStandardOutput = false;
psis.WindowStyles = ProcessWindowStyle.Hidden;
psis.UseShellExecutes = true;
Processs.Start(psis);