 |

01-09-2003, 03:39 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
Webbrowser control
|
|
I'm not sure if this should be in a web forum or not, but half of it has to do with vb, and the other half is on the web.
I made a vb application that has a webbrowser control. All I want is to make the web page only viewable through the application. I do not want to pass a variable in the url string of the webbrowser control, therefore I'm wondering if there is some way to change the User Agent information of the webbrowser control? Or maybe set something else in the control that I can test on the web page?
Any help would be great  .
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|

01-09-2003, 03:49 PM
|
 |
Obsessive OPtimizer
Administrator * Guru *
|
|
Join Date: Jun 2002
Location: Debug Window
|
|
No, but you could use the winsock control instead and specify anything you like 
|
__________________
Quis custodiet ipsos custodues.
|

01-09-2003, 04:06 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
|
|
Okay, thank you.
I've never used winsock before so I'm going to do a little reading here and on wincockvb.com, but just out of curiosity how would that be structured? Can the winsock control display webpages, or do I connect to the server with the winsock control and pass the info to a webbrowser control, or is it another senario?
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|

01-09-2003, 04:08 PM
|
 |
Obsessive OPtimizer
Administrator * Guru *
|
|
Join Date: Jun 2002
Location: Debug Window
|
|
__________________
Quis custodiet ipsos custodues.
|

01-09-2003, 04:31 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
That looks great OnErrOr ... I'm having a problem though. You mention making a reference to the winsock control, but I can't find it in Project - References. Do I need to download it from somewhere first?
Edit:
Oops .. never mind, I found it. Thanks.
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
Last edited by Cogen : 01-09-2003 at 04:42 PM.
|

01-09-2003, 06:16 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
Sorry, but I'm struggling a bit here. If I get winsock to return a string containing a web page, then how do I display it? Do I need to save it as an html file? If I display it in a webbrowser control, then the webbrowser will take over as the host instead of winsock. This isn't good because as soon as the user click on a link, the webbrowser will do all the work instead of winsock.
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
Last edited by Cogen : 01-09-2003 at 06:39 PM.
|

01-09-2003, 06:40 PM
|
 |
ISearchGoogle
Retired Moderator * Expert *
|
|
Join Date: May 2001
Location: england
|
|
You'd have to save it, then use a WebBrowser to display it.
|
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
|

01-09-2003, 06:52 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
Thanks for the reply ChiefRedBull  .
The problem is that I'm going to be passing information (header, or specific user agent string if possible) to the website through winsock. On the server side (PHP), I'm not going to allow anyone to view the site unless the header information is present. Therefore, if I save it as an html file and display it in a webbrowser control, the webbrowser control will take the data transfer responsibilities away from winsock, and it will not send the proper headers/useragent when the user navigates the site.
Does that make sense .. hehe (i hope). Is this even possible?
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|

01-09-2003, 07:09 PM
|
 |
ISearchGoogle
Retired Moderator * Expert *
|
|
Join Date: May 2001
Location: england
|
|
Cogen - you are misunderstanding. Once you've received and
saved the HTML from your server, it is displayed locally. The WB
control will only access the server for the images.. that's ok isn't
it?
|
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
|

01-09-2003, 11:24 PM
|
 |
Contributor
|
|
Join Date: Apr 2002
Location: Ontario, Canada
|
|
Yes, accessing the server for the images is fine. I understand that the html file will be stored locally, but my problem is that the local html file will have *a href=* links to other pages on the site. When the user clicks on those links, the webbrowser will go to the page, and that page will not be local, but on the server. From that point on, the webbrowser control handles everything, rather then winsock.
|
__________________
"I have not failed. I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|

01-10-2003, 04:58 AM
|
 |
ISearchGoogle
Retired Moderator * Expert *
|
|
Join Date: May 2001
Location: england
|
|
You can interrupt it - the WebBrowser has a BeforeNavigate
event, which you can cancel, then use the Winsock to download
the link that was clicked.
|
__________________
Chuck Norris ordered a Big Mac at Burger King, and got one.
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
| |
|