Results 1 to 6 of 6

Thread: How to use Process.Start method

  1. #1
    Join Date
    Nov 2009
    Posts
    51

    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.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    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);
    }

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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");
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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());   
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    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);

Similar Threads

  1. When and how to start the analytics process?
    By mADiRAkSHii in forum Technology & Internet
    Replies: 3
    Last Post: 25-01-2011, 05:58 PM
  2. Cannot start Server process after Windows 7 installation
    By Parakshit in forum Operating Systems
    Replies: 4
    Last Post: 17-12-2010, 12:50 AM
  3. Replies: 7
    Last Post: 12-06-2010, 05:48 PM
  4. Cannot start Windows Virtual PC Host Process
    By Faiz_4u in forum Operating Systems
    Replies: 3
    Last Post: 01-06-2009, 10:11 AM
  5. Unable to start wmipvse.exe process on Desktop
    By Suzane in forum Windows Software
    Replies: 2
    Last Post: 27-05-2009, 12:03 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,715,180,708.35286 seconds with 17 queries