Opening local files in Webkit .NET

前端 未结 7 2030
天涯浪人
天涯浪人 2021-01-20 11:33

A simple WebKitBrowser1.Navigate(localfilehere) doesn\'t work for some reason.

I tried adding \"file://\" to the URL but that didn\'t work either.

This seems

7条回答
  •  误落风尘
    2021-01-20 11:50

    WebKit.Net 0.5 Navigate() function takes string as its parameter(local/web files). For local file for e.g: c:\xxx\yyy zzz.htm can be passed to Navigate Function as follows:-

    dim sFile As String = "c:\xxx\yyy zzz.htm"
    Dim url as new Uri(sFile, UriKind.Absolute)
    
    'Now pass the file's required formatted absolute path
    WebKitBrowser1.Navigate(url.AbsoluteUri)
    

提交回复
热议问题