Table of Contents

Method SetVirtualHostNameToFolderMapping

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

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 string

A virtual host name.

folderPath string

A folder path name to be mapped to the virtual host name.

accessKind WebBrowserHostResourceAccessKind

The 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