Results 1 to 27 of 27

Thread: [RESOLVED] Browser Start

  1. #1

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Resolved [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?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  2. #2
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    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.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

  3. #3

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  4. #4

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  5. #5

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  6. #6

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Browser Start

    And changing the default browser to IE didn't help.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  7. #7
    Lively Member
    Join Date
    Jan 2010
    Location
    United Kingdom
    Posts
    115

    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.
    Regards
    Colin

    If my comments helped please remember to add to my reputation using Rate This Post.

    If your problem has been resolved please mark the thread resolved using the "Mark Thread Resolved" link in thread tools.

    CodeBank Submissions: 1) WebBrowser - Delete cookies etc 2) Import My.Settings from previous build version

  8. #8

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  9. #9

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  10. #10

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  11. #11
    Fanatic Member
    Join Date
    Mar 2008
    Posts
    519

    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" />

  12. #12
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  13. #13
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by Zeelia View Post
    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.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  14. #14

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  15. #15
    Addicted Member Spirited Machine's Avatar
    Join Date
    May 2009
    Posts
    215

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by dbasnett View Post
    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.

  16. #16
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by dbasnett View Post
    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.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  17. #17

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by chris128 View Post
    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?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  18. #18
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: [RESOLVED] Browser Start

    Did you miss post #12 ?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  19. #19

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by chris128 View Post
    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  20. #20
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  21. #21

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  22. #22

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  23. #23
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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..
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  24. #24

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by chris128 View Post
    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...
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  25. #25

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    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?
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

  26. #26
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    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.
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  27. #27

    Thread Starter
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: [RESOLVED] Browser Start

    Quote Originally Posted by chris128 View Post
    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.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width