Method SetVirtualHostNameToFolderMapping
SetVirtualHostNameToFolderMapping(string, string, WebBrowserHostResourceAccessKind)
Sets a mapping between a virtual host name and a folder path to make available to web sites via that host name.
void SetVirtualHostNameToFolderMapping(string hostName, string folderPath, WebBrowserHostResourceAccessKind accessKind)
Parameters
hostName
stringA virtual host name.
folderPath
stringA folder path name to be mapped to the virtual host name.
accessKind
WebBrowserHostResourceAccessKindThe level of access to resources under the virtual host from other sites.
Examples
WebControl1.SetVirtualHostNameToFolderMapping(
"appassets.example", "assets", WebBrowserHostResourceAccessKind.DenyCors);
WebControl1.Source = new Uri("https://appassets.example/index.html");
Remarks
After setting the mapping, documents loaded in the WebBrowser can use HTTP or HTTPS URLs at the specified host name specified by hostName to access files in the local folder specified by folderPath.
This property works only for the Edge backend.
- See Also