|
-
January 20th, 2009, 08:02 AM
#1
Access denied in WebBrowser control
I had the "smart" idea of replacing a RichTextBox control with a Webbrowser control, (never worked with html), so I created this class:
Code:
Imports System.IO
Imports System.Web
Friend Class MyBrowser
Inherits WebBrowser
Friend Shadows WriteOnly Property Texto() As String
Set(ByVal value As String)
DocumentText = value.Replace(vbCrLf, "<br/>")
End Set
End Property
Public Property MyFont() As Font
Get
Return MyBase.Font
End Get
Set(ByVal value As Font)
MyBase.Font = value
End Set
End Property
End Class
I enter the text on the webBrowser setting the Texto property, where I replaces all vbcrlf with "<br/>".
I wanted to replace a filename in the text, with a link to the filename this way:
Code:
"<A HREF=""javascript:window.open('file:///" & FileName & "'); void(0)"">" & FileName & "</A>"
(I pass that text to the webbrowser)
The problem is, At clicking in the link, it gives an error message box telling "Access denied".
I have found a workaround in this page
It advices:
 Originally Posted by link
Open up distributed COM configuration properties and
choose the default security tab. Under Default Access Permissions you
add 'Everyone' with Allow Access.
But it looks like a bad hack. Is there a better way to do it?
[Vb.NET 2008 (ex Express)]
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
|