Reputation: 552
Hi everybody
i want to display some HTML file in a visual basic 6 application and i use the browser object. is there anyway to prevent these files to be viewed by other browsers? in other words, i want only my application can access the HTML file's contents. could you bring me an example about your solution if you have one?
Note: the html files are inside user computer (offline). and i don't want to use .net
Thank u
Upvotes: 0
Views: 231
Reputation: 13267
The WebBrowser control (part of IE, not VB6) will accept navigation using the res:
protocol. This means you can embed HTML resources in your program or create separate HTML resource DLLs.
Use "HTML" as the resource type and the "file name" of each item as the resource id.
Then access is fairly simple:
WebBrowser1.Navigate "res://" & App.Path _
& "\" & App.EXEName _
& ".exe/HTML/sample.htm"
Images and other linked items can use relative URLs:
<body background="image.jpg">
... where image.jpg
is another HTML resource containing a JPEG image.
This doesn't provide anything like encryption but it does make casual spelunking and viewing of your HTML less likely.
Upvotes: 6