Click here to Skip to main content
15,911,142 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a situation in which I have a aspx page ,that hit on schedule ,all my logic is written in this page.I want that while this page is hit on schedule time,no console window or page that was hit,will not show up.what I have done to hide console window ,


 
But Problem is when that page is hit using this code ,that page open up in browser?


What I have tried:

1.just change it to window application output in application setting. 
2.and to start aspx page 

<pre lang="vb">
Dim url As String = ""
            url = ConfigurationManager.AppSettings("www.youtube.com")
            Process.Start(url)
Posted
Updated 20-Mar-17 23:43pm

When you use Process.Start, it starts a new Windows application - which means that the operating system looks at the file you told it to deal with, finds the appropriate application to open it and starts that. in this case, it's a URL, so Windows will automatically open a browser window - exactly as if you had typed "www.youtube.com" into a windows explorer address bar. You cannot prevent that, except by changing the default internet browser for the whole of windows.

If you want to "open" a website without displaying it, you will have to either use a WebBrowser control in a non-console app, or the WebClient Class (System.Net)[^] and process it manually.
 
Share this answer
 
Comments
Sajid227 21-Mar-17 4:37am    
Nice explanation.I want to use this solution in web job in cloud.I want to run the code of this aspx page,which is written in page_load method.without showing page or console window to end user,will your propose solution help me this way?
VB
Dim url As String = ""
           url = ConfigurationManager.AppSettings("url")
           Dim client As New WebClient
           client.Dispose()
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900