共用方式為


CoreWebView2.SaveFileSecurityCheckStarting Event

Definition

This event will be raised during system FileTypePolicy checking the dangerous file extension list.

        Developers can specify their own logic for determining whether
        to allow a particular type of file to be saved from the document origin URI.
        Developers can also determine the save decision based on other criteria.

        Here are two properties in <xref data-throw-if-not-resolved="true" uid="Microsoft.Web.WebView2.Core.CoreWebView2SaveFileSecurityCheckStartingEventArgs"></xref> to manage the decision, <xref data-throw-if-not-resolved="true" uid="Microsoft.Web.WebView2.Core.CoreWebView2SaveFileSecurityCheckStartingEventArgs.CancelSave"></xref> and <xref data-throw-if-not-resolved="true" uid="Microsoft.Web.WebView2.Core.CoreWebView2SaveFileSecurityCheckStartingEventArgs.SuppressDefaultPolicy"></xref>.
        Table of Properties' value and result:
        <table><thead><tr><th></th><th>CancelSave</th><th>SuppressDefaultPolicy</th><th>Result</th></tr></thead><tbody><tr><td></td><td>False</td><td>False</td><td>Perform the default policy check. It may show the security warning UI if the file extension is dangerous.</td></tr><tr><td></td><td>False</td><td>True</td><td>Skip the default policy check and the possible security warning. Start saving or downloading.</td></tr><tr><td></td><td>True</td><td>Any</td><td>Skip the default policy check and the possible security warning. Abort save or download.</td></tr></tbody></table>
public event EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2SaveFileSecurityCheckStartingEventArgs> SaveFileSecurityCheckStarting;
member this.SaveFileSecurityCheckStarting : EventHandler<Microsoft.Web.WebView2.Core.CoreWebView2SaveFileSecurityCheckStartingEventArgs> 
Public Custom Event SaveFileSecurityCheckStarting As EventHandler(Of CoreWebView2SaveFileSecurityCheckStartingEventArgs) 

Event Type

Remarks

Developers can specify their own logic for determining whether to allow a particular type of file to be saved from the document origin URI. Developers can also determine the save decision based on other criteria. Here are two properties in CoreWebView2SaveFileSecurityCheckStartingEventArgs to manage the decision, CancelSave and SuppressDefaultPolicy. Table of Properties' value and result:

CancelSaveSuppressDefaultPolicyResult
FalseFalsePerform the default policy check. It may show the security warning UI if the file extension is dangerous.
FalseTrueSkip the default policy check and the possible security warning. Start saving or downloading.
TrueAnySkip the default policy check and the possible security warning. Abort save or download.

Applies to