|
-
Apr 24th, 2010, 04:08 PM
#1
[RESOLVED] Browser Start
I am using the following code to access PayPal
Code:
Dim trgt2 As String = "https://www.paypal.com/cgi-bin..."
System.Diagnostics.Process.Start(trgt2)
It takes a good 30 - 40 seconds to begin to open the page. I use FireFox and the browser was open when the code executed. Am I missing something?
-
Apr 25th, 2010, 03:08 AM
#2
Lively Member
Re: Browser Start
Hi
I am assuming the following is not the full url.
Code:
Dim trgt2 As String = "https://www.paypal.com/cgi-bin..."
Tried this in a test project with Firefox open and the following line attempted to open the page in a new tab.
Code:
System.Diagnostics.Process.Start(trgt2)
However, I got a page not found message. I can understand you not wanting to post the full url to a secure page. Have you tried your code with a different url. It may be impossible for forum members to help if we can't figure out what is causing your problem.
-
Apr 25th, 2010, 04:03 AM
#3
Re: Browser Start
Same with this
Code:
Dim trgt1 As String = "http://www.vbforums.com/showthread.php?t=612471"
System.Diagnostics.Process.Start(trgt1)
I updated FireFox yesterday after I noticed the behavior, and that didn't help.
-
Apr 25th, 2010, 04:23 AM
#4
Re: Browser Start
If I do it this way
Code:
Dim pi As New ProcessStartInfo
pi.FileName = "firefox.exe"
pi.Arguments = trgt1
System.Diagnostics.Process.Start(pi)
The problem does not happen, but now I have a new problem. How do I fill in the name of the file, I can't assume the user wants / has any browser.
-
Apr 25th, 2010, 04:34 AM
#5
Re: Browser Start
If you explicitly specify a browser the launch happens quickly. If you do it like this
Code:
Dim pi As New ProcessStartInfo
pi.FileName = trgt1
System.Diagnostics.Process.Start(pi)
it is slow.
-
Apr 25th, 2010, 04:44 AM
#6
Re: Browser Start
And changing the default browser to IE didn't help.
-
Apr 25th, 2010, 04:57 AM
#7
Lively Member
Re: Browser Start
Is there any reason why you can't just use the webbrowser control? That would get rid of the problem you just specified.
-
Apr 25th, 2010, 06:22 AM
#8
Re: Browser Start
My thinking was that if the user had a perfectly good browser already running, then why not use it. I hate applications that fire up windows, willy nilly.
-
Apr 25th, 2010, 07:10 AM
#9
Re: Browser Start
Ok, so the answer is dig around in the registry to get the default executable.
Code:
Dim brwsrKey As String = "HKEY_CURRENT_USER\Software\Classes\http\shell\open\command"
Dim brwsr As String = Microsoft.Win32.Registry.GetValue(brwsrKey, "", "").ToString
Dim foo() As String = brwsr.Split(New Char() {""""c}, StringSplitOptions.RemoveEmptyEntries)
foo(0) has that.
-
Apr 25th, 2010, 09:09 AM
#10
Re: Browser Start
The registry solution only works on my PC. On the other XP machine and windows 7 it did not work at all.
-
Apr 25th, 2010, 09:41 AM
#11
Fanatic Member
Re: [RESOLVED] Browser Start
Remember that different OSes has different registrypaths.
Have you checked your other machines if they have the same registrypaths?
Also remember that if you are running on Vista and Windows 7, you need to either disable UAC or change a line in your app.manifest file so that your application executes in administrator level.
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
-
Apr 25th, 2010, 05:12 PM
#12
Re: [RESOLVED] Browser Start
Process.Start("http://www.vbforums.com") works perfectly fine on my machine (launches IE and loads the page within a couple of seconds) and I have IE 8 and Opera 10 installed. Have you confirmed that you have this problem on any other PCs than your own?
-
Apr 25th, 2010, 05:13 PM
#13
Re: [RESOLVED] Browser Start
 Originally Posted by Zeelia
Also remember that if you are running on Vista and Windows 7, you need to either disable UAC or change a line in your app.manifest file so that your application executes in administrator level.
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
Why? The registry key he is accessing is in HKEY_CURRENT_USER so I dont think there would be any permissions issues.
-
Apr 25th, 2010, 05:21 PM
#14
Re: [RESOLVED] Browser Start
I ended up just creating my own browser.
I am done with this bs. What a joke! I am not trying to calculate the orbits of the planets. Surely someone at Microsoft would have thought of a default webbrowser object.
something like
Code:
dim foo as defBrowser
foo.OpenNewTab=True
foo.url = "www.apple.com"
foo.go or .start , etc.
And the default web browser would magically appear with your url, without all this mickey mouse stuff.
-
Apr 25th, 2010, 06:41 PM
#15
Addicted Member
Re: [RESOLVED] Browser Start
 Originally Posted by dbasnett
I ended up just creating my own browser.
I am done with this bs. What a joke! I am not trying to calculate the orbits of the planets. Surely someone at Microsoft would have thought of a default webbrowser object.
something like
Code:
dim foo as defBrowser
foo.OpenNewTab=True
foo.url = "www.apple.com"
foo.go or .start , etc.
And the default web browser would magically appear with your url, without all this mickey mouse stuff.
Well as Chris128 pointed out, it works fine on his computer. And mine as well, using your first code. No delay at all here.
-
Apr 26th, 2010, 04:01 AM
#16
Re: [RESOLVED] Browser Start
 Originally Posted by dbasnett
I ended up just creating my own browser.
I am done with this bs. What a joke! I am not trying to calculate the orbits of the planets. Surely someone at Microsoft would have thought of a default webbrowser object.
something like
Code:
dim foo as defBrowser
foo.OpenNewTab=True
foo.url = "www.apple.com"
foo.go or .start , etc.
And the default web browser would magically appear with your url, without all this mickey mouse stuff.
Surely as a programmer you realise how impossible that is. There is no standard set of commands that every web browser has to implement (e.g to open a new tab) so why on earth would microsoft include something in the .NET framework that would be as unreliable as a 'default web browser' class. If they included such a thing then people would just complain that it didnt work with browser X because basically the only browser MS can be sure they can work with is IE - hence the WebBrowser control that essentially is IE.
To me the best idea would be to have the operating system decide what browser to launch if it realises someone is trying to launch a URL, based on the default browser that the user has set... oh wait, that is what already happens.
-
Apr 26th, 2010, 05:42 AM
#17
Re: [RESOLVED] Browser Start
 Originally Posted by chris128
Surely as a programmer you realise how impossible that is. There is no standard set of commands that every web browser has to implement (e.g to open a new tab) so why on earth would microsoft include something in the .NET framework that would be as unreliable as a 'default web browser' class. If they included such a thing then people would just complain that it didnt work with browser X because basically the only browser MS can be sure they can work with is IE - hence the WebBrowser control that essentially is IE.
To me the best idea would be to have the operating system decide what browser to launch if it realises someone is trying to launch a URL, based on the default browser that the user has set... oh wait, that is what already happens.
Gosh, you are right about the complaining. I made something up and you complained about one of the properties of the made up object.
@spirited - Your post was the first that indicated that anyone had tried this
Code:
Dim trgt1 As String = "http://www.vbforums.com/showthread.php?t=612471"
System.Diagnostics.Process.Start(trgt1)
and it wasn't slow. On the three machines I have in the house it is slow. One is a month old Win 7, one is a recently re-installed XP, and my PC. So are you sure it isn't slow?
-
Apr 26th, 2010, 05:46 AM
#18
Re: [RESOLVED] Browser Start
-
Apr 26th, 2010, 05:57 AM
#19
Re: [RESOLVED] Browser Start
 Originally Posted by chris128
Did you miss post #12 ?
Yes.
And as I pointed out I have the problem on three machines. One a brand new (month old) Windows 7 machine. Do you have the Windows Firewall turned on?
I run firefox the other two IE.
-
Apr 26th, 2010, 07:20 AM
#20
Re: [RESOLVED] Browser Start
I think I do have windows firewall turned on on my Windows 7 machine that I tested it on last night, but I dont have it on on this Windows XP machine I'm using right now, and that still works fine. Perhaps there is some program you have installed on all 3 of your machines that causes this?
-
Apr 26th, 2010, 07:24 AM
#21
Re: [RESOLVED] Browser Start
Not that I am aware of. The Windows 7 machine is Honey's machine, and I don't use it. One of the XP machines was her old one that she killed with viruses and had to be reformatted / reinstalled. The other XP machine is mine and NO ONE but me is allowed near it.
-
Apr 26th, 2010, 07:34 AM
#22
Re: [RESOLVED] Browser Start
I am going to run CC Cleaner and see what is what. My PC has not been well since XP SP3 install.
-
Apr 26th, 2010, 07:39 AM
#23
Re: [RESOLVED] Browser Start
Hmm that is odd then, I've tried it on another machine here and it worked fine as well. Can you just explain exactly what happens - you already have your browser open (I understand it is the same no matter which browser you are using?) and you run Process.Start("http://blah") and then is it just 40 seconds before anything happens at all or does the tab appear and start loading the web page but that takes 40 seconds to load? or neither?
EDIT: I just tried it on another machine and it did take quite a while but to be honest that machine is pretty slow anyway so im not sure if it was just that..
-
Apr 26th, 2010, 08:07 AM
#24
Re: [RESOLVED] Browser Start
 Originally Posted by chris128
Hmm that is odd then, I've tried it on another machine here and it worked fine as well. Can you just explain exactly what happens - you already have your browser open (I understand it is the same no matter which browser you are using?) and you run Process.Start("http://blah") and then is it just 40 seconds before anything happens at all or does the tab appear and start loading the web page but that takes 40 seconds to load? or neither?
EDIT: I just tried it on another machine and it did take quite a while but to be honest that machine is pretty slow anyway so im not sure if it was just that..
No tab, no nothing. When the tab appears (about 30-40 seconds) the page loads immediately. I am wondering if some association is hosed, but can't explain what is on all three that causes this behavior. They are not even running the same anti-virus program.
Oh, CCleaner didn't find anything unusual, except Sun Java had 33,000 files...
-
Apr 26th, 2010, 08:59 AM
#25
Re: [RESOLVED] Browser Start
Well, I think the problem IS file associations. I opened an excel spreadsheet and it is taking forever. I'll bet that this is why VS2010 publish takes so long.
The question is how / why did it happen, and how to fix it? Any suggestions?
-
Apr 26th, 2010, 09:33 AM
#26
Re: [RESOLVED] Browser Start
Are you sure it is not just your PC being generally slow? If you are saying that publishing from VS2010 takes forever, opening an excel spreadsheet takes forever, and opening a new tab in a browser takes forever... I would not conclude that there is a problem with pretty much every file association on the PC - I would conclude that there is a problem with the PCs performance in general.
Anyway if you do want to look at file associations, they are all stored in HKEY_CLASSES_ROOT in the registry so have a look in there and compare the values for file extensions that you are having problems with to a PC that does not have that problem.
-
Apr 26th, 2010, 10:55 AM
#27
Re: [RESOLVED] Browser Start
 Originally Posted by chris128
Are you sure it is not just your PC being generally slow? If you are saying that publishing from VS2010 takes forever, opening an excel spreadsheet takes forever, and opening a new tab in a browser takes forever... I would not conclude that there is a problem with pretty much every file association on the PC - I would conclude that there is a problem with the PCs performance in general.
Anyway if you do want to look at file associations, they are all stored in HKEY_CLASSES_ROOT in the registry so have a look in there and compare the values for file extensions that you are having problems with to a PC that does not have that problem.
If I start excel it opens fast. If I open a file from excel it is fast. If I close excel and double click an excel file it is slow.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|