Код: Выделить всё
[img]cid:image002.png@01XXXXXX.6144X4XX[/img]
' Get the email body as HTML content
Dim htmlBody As String = selectedMailItem.HTMLBody
' Create a new local folder to store the HTML content
Dim folderPath As String = "C:\Temp\"
Directory.CreateDirectory(folderPath)
' Create a unique file name for the HTML content
Dim fileName As String = Guid.NewGuid().ToString().Substring(0, 5) + ".html"
Dim filePath As String = Path.Combine(folderPath, fileName)
' Save the HTML content to the local file
File.WriteAllText(filePath, htmlBody)
' Map the virtual host name to the local folder
Await webView.EnsureCoreWebView2Async(Nothing)
' MsgBox(folderPath)
webView.CoreWebView2.SetVirtualHostNameToFolderMapping("localhost", folderPath, CoreWebView2HostResourceAccessKind.DenyCors)
' Load the HTML content into the WebView control
Dim c_nav As String = (http://localhost/ + fileName)
'webView.CoreWebView2.Navigate(c_nav)
webView.Source = New Uri(c_nav)
< /code>
Я установил сохранение его во временном файле, который я планирую реализовать метод удаления сразу после. Я пытался читать это обычно из HTMLBODY, используя .navigatetoString, и это, очевидно, не работало, поскольку он не поддерживает дополнительные веб -ресурсы. Для corewebview2hostresourceccesskind.denycors я попробовал это с. Allow и .deny и я все еще получил значок сломанного изображения. Есть ли другой обходной путь, который я могу попробовать, или я делаю это неправильно?>
Подробнее здесь: https://stackoverflow.com/questions/763 ... n-webview2
Мобильная версия