Xilium.CefGlue CEF Chrome 自动上传文件不弹出对话框 CefDialogHandler

时间:2022-04-17 13:06:43

关键代码如下,如何使用Handler,还不清楚的请继续搜索

internal sealed class WyzCefDialogHandler : CefDialogHandler
    {      
        protected override bool OnFileDialog(CefBrowser browser, CefFileDialogMode mode, string title, string defaultFilePath, string[] acceptFilters, int selectedAcceptFilter, CefFileDialogCallback callback)
        {
            string[] filePaths=new  string[1];
            filePaths[0]= @"D:\Temp\Help_files\2016072213550813.png";
            callback.Continue(0, filePaths);
            return true;//return false;--false是取消的问题
        }
    }