Results 1 to 16 of 16

Thread: webbrowser control [UNRESOLVED]

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    webbrowser control [UNRESOLVED]

    I have been looking for an answer to this for a long time, but I still have yet to come up with any solution.

    My application has a webbrowser control in it. This control is used to get information from our website to give to the end user. The end user never actually sees the data in the webbrowser control because it is on a hidden form. For example, this program needs to be activated on our server for them to use it. When they put the cd key in, it sends it as a parameter on a url to our website which validates it and returns a good or bad response. the response is read in and if good they continue, if not it haults the application.

    so my problem is that people with firewalls seem to be having trouble getting this to work. I would think since this is the webbrowser control, that if they can get out to the internet with internet explorer, then my app should be able to do the same, but for whatever reason, this is not the case. I tried installing zonealarm to replicate the problem, and when i get the popup authorizing access, it tells me the destination IP is 127.0.0.1 with a different port number each time. Why it is using this IP is odd to me, and why its not working is a bigger mystery.

    Is there a better method I can use to navigate to webpages? Why wont this work in my app?
    Last edited by kleinma; Aug 2nd, 2004 at 03:56 PM.

  2. #2
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Not sure whats causing that but you could try running an ASP script on the server and connect directly to a database on your server using ADO.

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    I don't know what you mean?

    The problem is that the internet explorer webbrowser control can't connect to our website on some of the users systems. What does this have to do with ADO, or ASP script?

  4. #4
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Was just a suggestion, you asked for a different way to connect to your server.

    Say you build a db of cd keys well you can connect to that db using ADO and ASP and validate the keys as required.

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    thats exactly what it does. My app that is on the clients computer simply reads the text that is output by the asp code in plain HTML

    the problem is that the webbrowser control isn't even able to connect to the web page at all... its like its being blocked from internet access

  6. #6
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959
    Yup i know what your saying and i cant see how this would make a difference but you never know, for example you could,

    VB Code:
    1. Dim rs As New ADODB.Recordset
    2.     Dim url As String
    3.     url = "http://www.yoursite.com/"
    4.     rs.Open url & "get.asp?ID=" & Val(txtID) & ""

    and communicate to the server like that.

  7. #7
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    HOW ABOUT A BETTER SOLUTION THAT I KNOW WORKS!
    BTW, the webbrowser control has problems with the firewall. Try the following code.

    VB Code:
    1. 'REFERENCE MICROSOFT INTERNET CONTROLS
    2.  
    3. 'Declarations:
    4. '----------------
    5. Public Declare Function GetTickCount Lib "kernel32" () As Long
    6.  
    7. Public IE As InternetExplorer
    8.  
    9.  
    10.  
    11. 'Form Code:
    12. '--------------
    13.   Dim StartTime As Long
    14.   Dim RetryCount As Long
    15.  
    16.   Set IE = New InternetExplorer 'Start a new IE session
    17.   IE.Visible = False 'Make the browser invisible to the user
    18.  
    19.  
    20. Retry:
    21.   RetryCount = RetryCount + 1   'The number of times we tried to access the page
    22.  
    23.   If RetryCount > 3 Then  'If we retried more than 3 times, exit the sub
    24.     IE.Quit   'Close the browser
    25.     Set IE = Nothing
    26.    
    27.     Exit Sub
    28.   End If
    29.  
    30.   IE.Navigate "http://yahoo.com" 'Navigate to the given URL
    31.  
    32.   StartTime = GetTickCount()  'Store the current time
    33.  
    34.   While IE.ReadyState <> 4  'Wait while the browser is busy
    35.     If (StartTime + 3000) < GetTickCount Then GoTo Retry  'Give it 3 seconds before retrying
    36.     DoEvents
    37.   Wend
    38.  
    39.   Msgbox IE.Document.documentElement.OuterHTML
    40.  
    41.   IE.QUit
    42.   Set IE = nothing
    Last edited by VIP3R; Aug 2nd, 2004 at 06:26 PM.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  8. #8
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    Just to tell you, that code has passed many fire alarms. I know that it bypasses mine (Crappy WinXP firewall) and my friend's firewall (Norton "i think"). However, I haven't heard of any problems from anyone with a firewall but I can't say I've tested it with all firewalls.

    I hope my post didn't go to waste and that I have solved your problem.
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  9. #9

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    ill check it out tomorrow when i am at work.

    I will impliement that code and upload it to the client having troubles. Then I will let you know the result.

    Thanks for the post

  10. #10
    Hyperactive Member
    Join Date
    Nov 2003
    Location
    In Front of my computer...
    Posts
    367
    It works bypassed ZoneAlarm Pro i have
    Good code there
    Born to help others
    (If I've been helpful then please rate my post. Thanks)

    call me EJ or be slapped!

  11. #11

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by EJ12N
    It works bypassed ZoneAlarm Pro i have
    Good code there
    well i guess its not bypassing, its using permissions already given to internet explorer

  12. #12
    Frenzied Member ice_531's Avatar
    Join Date
    Aug 2002
    Location
    Sitting w/ Bob Status: -Next -To- Null- Friend: Philip
    Posts
    1,152
    i use inet...to download a page n search the data to see if program is enabled or not. Havent had any problems so far and people with firewalls havent complained ( other than when i disable the program )

    but my method is farely simple .. as i have a page say test.html on my server and i have the program check it to see if it contains a word " disable " or sumthin...then go from there


    ice
    :::`DISCLAIMER`:::
    Do NOT take anything i have posted to be truthful in any way, shape or form.
    Thank You!

    --------------------------------
    "Never heard about "hiking" poles. I usualy just grab a stick from the nature, and use that as a pole." - NoteMe
    "Finaly I can look as gay as I want..." - NoteMe
    Languages: VB6, BASIC, Java, C#. C++

  13. #13

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    is there anyway to use the IE object instead of the webbrowser object but still have it inside an application instead of being a seperate window?

  14. #14

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by kleinma
    is there anyway to use the IE object instead of the webbrowser object but still have it inside an application instead of being a seperate window?
    I used a combination of SetWindowLong, SetWindowPos, and SetParent APIs to achieve this

  15. #15
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    879
    lol Just pointing out some of my typing mistakes:

    Just to tell you, that code has passed many fire alarms.
    I didn't notice it until now :P. It's good to know that my code doesn't set off the fire alarm!
    Visual Basic 6.0
    Visual C++ 5
    Delphi 5


  16. #16

    Thread Starter
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    Originally posted by VIP3R
    lol Just pointing out some of my typing mistakes:



    I didn't notice it until now :P. It's good to know that my code doesn't set off the fire alarm!
    lol i guess i didnt really notice because i knew what you meant

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