web browser control
web browser control
web browser control
web browser control
web browser control
web browser control web browser control web browser control web browser control web browser control web browser control web browser control web browser control
web browser control web browser control
web browser control
Go Back  Xtreme Visual Basic Talk > > > web browser control


Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2006, 02:55 PM
jimmay jimmay is offline
Junior Contributor
 
Join Date: Dec 2004
Location: Canada
Posts: 225
Default web browser control


hello, i have a program that listens on a socket for the string "connect" from a client program. When my program seed "connect" as the data, it loads up a new form with the web browser control, and tells the control to navigate to a specific site. the web browser control does its work, then closes, and opens up the socket for a new connection.

When a new connection comes in, a new web browser control form loads up, but this time, its at the last page i was at; maybe something to do with cookies, cache, history. If i close down the whole program and start again, i start off at the actual site i was supposed to begin with on the second try.

using the web browser control, how can i disable the control from using the cache, history? I took note of a site on msdn that said i can pass certain flags to the .navigate event. Flags of interest were;

Public Const navNoHistory = &H2
Public Const navNoReadFromCache = &H4
Public Const navNoWriteToCache = &H8

And i made use of them as so

webbrowser1.navigate "http://www.site.com", navNoHistory & navNoReadFromCache & navNoWriteToCache

....so, my question is, are these the correct hex values for these flags, and does my use of & equate to "and this constant"?

nonetheless, i want the webbrowser control to load the actual starting page each time, not pages based on cookies, cache, history after the first time.


Thanks!
Reply With Quote
  #2  
Old 06-21-2006, 03:06 PM
MikeJ's Avatar
MikeJweb browser control MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Are you loading/unloading the webbrowser control's form? Or just hiding it? If you hide it, you are just showing what was previously there, you need to unload the form when you are done, and load it anew once you've established a connection.

Also, you will want to use the And operator:
Code:
navNoHistory And navNoReadFromCache And navNoWriteToCache
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
  #3  
Old 06-21-2006, 03:38 PM
jimmay jimmay is offline
Junior Contributor
 
Join Date: Dec 2004
Location: Canada
Posts: 225
Default

Quote:
Originally Posted by MikeJ
Are you loading/unloading the webbrowser control's form? Or just hiding it? If you hide it, you are just showing what was previously there, you need to unload the form when you are done, and load it anew once you've established a connection.

Also, you will want to use the And operator:
Code:
navNoHistory And navNoReadFromCache And navNoWriteToCache
Yes, i tried it all. still not working. i think its something to do with cookies. i have attached source code for those who would like to see. note: you need to change your interface address to something like 127.0.0.1 and change If data = "dyndns" Then to "if data <> vbnullstring"

then, telnet 127.0.0.1 and type a character and a return value.

Lastly, would anyone know how i can list the number of forms (frmweb) loaded? thanks.
Attached Files
File Type: zip DYN.zip (3.9 KB, 11 views)
Reply With Quote
  #4  
Old 06-23-2006, 04:51 AM
DougT's Avatar
DougT DougT is offline
Ultimate Antique

Administrator
* Expert *
 
Join Date: Sep 2005
Location: Maldon,Essex, UK
Posts: 3,939
Default

Hi,

I think MikeJ meant Or rather than And
Code:
navNoHistory Or navNoReadFromCache Or navNoWriteToCache
__________________
semel insanivimus omnes
S Data in context = Information, S Information in context = Knowledge, S Knowledge in context = Experience
S Experience in context = Wisdom= Data
Reply With Quote
  #5  
Old 06-23-2006, 01:54 PM
MikeJ's Avatar
MikeJweb browser control MikeJ is offline
Retread

Retired Moderator
* Expert *
 
Join Date: Sep 2002
Location: Austin, Texas
Posts: 6,747
Default

Doug, this is what I get answering questions after 48 hours of no sleep. It should be Or.

jimmay, I don't have VB6 installed on this computer to test, but I'm pretty sure this will do for counting the number of loaded forms. Basically, you declare an object of the frmWeb type, then iterate through the Forms collection, incrementing a counter:
Code:
Private Function GetNumberLoaded() As Integer Dim counter as Integer Dim frm As frmWeb For Each frm in Forms counter = counter + 1 Next ' GetNumberLoaded = counter End Function

Now, just call it like so:
Code:
Private Sub Whatever() MsgBox GetNumberLoaded End Sub
__________________
{ Lex Fori } { Locus Classicus } { Rutilus Scrinium }
Osculare pultem meam!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
web browser control
web browser control
web browser control web browser control
web browser control
web browser control
web browser control web browser control web browser control web browser control web browser control web browser control web browser control
web browser control
web browser control
 
web browser control
web browser control
 
-->