1、 一、Xilium.CefGlue. CefApp (CefApp.cs文件)類on_before_command_line_processing方法內設置flash路徑、版本號等。 m_commandLine.AppendSwitch("ppapi-flash-path", @"*\PepperFlash\pepflashplayer.dll"); m_commandLine.AppendSwitch("ppapi-flash-version", "2*.*.*.306"); 二、設置Cef緩存 cefSettings = new CefSettings { CachePath = @"Temp\Cache\", NoSandbox = false, **** }; 三、設置Cef Flash 信任目錄 //flash信任路徑配置文件夾 string strFlashSettingPath = string.Format(@"{0}Temp\Cache\Pepper Data\Shockwave Flash\WritableRoot\#Security\FlashPlayerTrust", AppDomain.CurrentDomain.BaseDirectory); if (!Directory.Exists(strFlashSettingPath)) { Directory.CreateDirectory(strFlashSettingPath); } //flash配置文件路徑 string strFlashSettingFilePath = Path.Combine(strFlashSettingPath,"trust.cfg"); using (StreamWriter sw = new StreamWriter ( strFlashSettingFilePath , true, System.Text.Encoding.UTF8)) { sw.WriteLine(Path.GetPathRoot(strFlashSettingFilePath)); sw.Close(); } 2、附:如何添加受信任位置 第一種辦法: 在Flash插件上右鍵->全局設置->高級->開發人員工具->受信任的位置設置->添加 ,而後添加你的文件或者文件夾便可。 說明:在本地測試期間,Flash Player 能夠顯示阻止應用程序正常運行的安全警告。您能夠使用「受信任位置設置」面板將您本身的 SWF 或 FLV 內容指定爲可信內容,從而解決這一問題。您能夠將個別文件的路徑指定爲可信路徑,或者指定文件夾爲可信文件夾。可信文件夾中的全部文件及其任何子文件夾也會受信任。使用此選項卡可指定您計算機上包含您信任的 SWF 或 FLV 內容的位置。可信內容不遵循阻止內容訪問 Internet 和本地計算機文件系統的安全規則。 第二種方法: 在C:\WINDOWS\system32\Macromed\Flash\FlashPlayerTrust目錄下添加一個文件,好比:1.txt(文件名可任意起),文件內容爲項目的路徑,固然也能夠設置爲「D:\」 說明:爲了讓你的Flash在用戶硬盤中擁有同時訪問網絡和本地的能力,你必須在用戶計算機的FlashPlayerTrust目錄中爲你的Flash添加權限.FlashPlayerTrust 配置文件。 這些是列出受信任路徑的簡單文本文件。這些文件由可執行的安裝程序建立。當安裝程序將 SWF 安裝到用戶的計算機時, 它可以安裝信任的配置文件並指定 SWF 是受信任的。 3、參考: 深刻理解Flash Player的安全域(Security Domains) 網址:https://blog.csdn.net/yaonai2003/article/details/8771359