|
-
Feb 27th, 2001, 02:25 PM
#1
Well, see the subject.
I basically need the webbrowser to be able to navigate to a page, download it, have my program decrypt the page and display it.
Ideas, anyone?
Gerco.
-
Feb 27th, 2001, 02:27 PM
#2
Frenzied Member
do you need the .html source
webBrowser.document is the html sourse!!
-
Feb 27th, 2001, 02:30 PM
#3
Well, no.
When I do: msgbox Webbrowser1.document it just displays: [object]
And I need the source before the control displays it, then I need to change it and then the control must display it. The control won't recognise the file as HTML, because it needs to be decrypted first.
Gerco.
-
Feb 27th, 2001, 02:39 PM
#4
Frenzied Member
sorry try:
Webbrowser1.document.innerHtml
i think it's that
-
Feb 27th, 2001, 02:57 PM
#5
Code:
html = crypt(html, key)
WebBrowser1.Document.innerHtml = html
Gives me:Runtime error: 438: Object Doesn't support this property or method
Gerco.
-
Feb 27th, 2001, 03:04 PM
#6
Frenzied Member
ohhhhhhhhhhhhhhhhh
you want to set the html in the webBrowser
i don't know how, i dunno if you can!!
sorry for the missunderstanding
-
Feb 27th, 2001, 03:06 PM
#7
Frenzied Member
In that case try this:
put your generated html in an .html file that you will
create, and then just point the webBrowser to this .html file,
how does this sound!!
-
Feb 27th, 2001, 03:06 PM
#8
Never mind..
I just want to give the webbrowser an url, it downloads the data, notifies me (by an event, already done), I decrypt the document, and give it to the webbrowser.
The webbrowser will then display the decrypted document.
Gerco.
-
Feb 27th, 2001, 03:12 PM
#9
It's actually this:
Code:
Text1.Text = WebBrowser1.Document.documentElement.innerHTML
-
Feb 27th, 2001, 03:12 PM
#10
Frenzied Member
not sure what you mean with the decript part,but
you CAN'T set the webBrowser document(as far as i know)
try what i suggest:
I just want to give the webbrowser an url, it downloads the data, notifies me (by an event, already done), I decrypt the document
****************
put the decrypt document in a .html file that you will create
****************
, and give it to the webbrowser.
oh well,
maybe that what i'll do!!
-
Feb 27th, 2001, 03:36 PM
#11
Works kinda nice Matthew, but still some trouble:
Code:
Private Sub WebBrowser1_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
If Right$(UCase$(URL), 3) <> "GTW" Then Exit Sub
Dim urlToOpen As String
urlToOpen = URL
MsgBox "Decoding " & urlToOpen
b() = Inet1.OpenURL(urlToOpen, icByteArray)
For i = LBound(b) To UBound(b)
html = html & Chr$(b(i))
Next i
Open App.Path & "\tmp.html" For Output As 1
Print #1, crypt(html, key)
Close 1
WebBrowser1.Navigate2 App.Path & "\tmp.html"
Cancel = True
End Sub
The idea is: when the browser loads an URL with .gtw extension, it loads the file and decodes it, then points the webbrowser to the temp file.
The problem: when the webbrowser finishes loading the temp file, it continues to a navcancel page because of the cancel=true in the code.
And when I try and get the browser to download the file itself, it pops up a dialogbox asking me if I want to save the file, because it doesn't recognise the file format :-(
Ideas anyone?
Gerco.
-
Feb 27th, 2001, 03:43 PM
#12
Hyperactive Member
I don't suppose this would work but have you tried cancelling first and then making the browser navigate to the temp file you decrypted?
Achichincle
VB6 (VSEE SP5, W2KPro)
ASP
HTML
-
Feb 27th, 2001, 04:20 PM
#13
New Member
You can set the html source code directly as shown below:
WebBrowser1.Navigate "about:<html>your text here
<img src='c:\Internet\somefile.gif'></img></body></html>"
You don't need to 'Navigate' to an external file.
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
|