Back to Devexpress

AsyncDownloadPolicy.RegisterTrustedUri(Uri) Method

corelibraries-devexpress-dot-data-dot-asyncdownloadpolicy-dot-registertrusteduri-x28-system-dot-uri-x29.md

latest2.6 KB
Original Source

AsyncDownloadPolicy.RegisterTrustedUri(Uri) Method

Trusts the specified resource.

Namespace : DevExpress.Data

Assembly : DevExpress.Data.v25.2.dll

NuGet Package : DevExpress.Data

Declaration

csharp
public static void RegisterTrustedUri(
    Uri uri
)
vb
Public Shared Sub RegisterTrustedUri(
    uri As Uri
)

Parameters

NameTypeDescription
uriUri

The trusted resource.

|

Remarks

If a restrictive download policy is active, use the RegisterTrustedUri method to create a “safe” resource whitelist. Downloads from whitelist resources bypass policy restrictions.

csharp
static void Main() {
    DevExpress.Data.AsyncDownloadPolicy.SuppressAll();
    DevExpress.Data.AsyncDownloadPolicy.RegisterTrustedUri(new Uri("https://www.devexpress.com"));
    Application.Run(new Form1());  
}
vb
Shared Sub Main()
    DevExpress.Data.AsyncDownloadPolicy.SuppressAll()
    DevExpress.Data.AsyncDownloadPolicy.RegisterTrustedUri(New Uri("https://www.devexpress.com"))
    Application.Run(New Form1())
End Sub

Note

Masked resource registration is not available. If you need to validate various requests made to the same host, apply the SuppressAll() policy and handle the Downloading event to manually inspect each connection/resource.

Read the following topic for detailed information and examples: Suppress Control Requests to Download Data from External URLs.

See Also

IsTrustedUri

Downloading

Downloaded

AsyncDownloadPolicy Class

AsyncDownloadPolicy Members

DevExpress.Data Namespace