| | |
| | | using CefSharp; |
| | | using CefSharp.WinForms; |
| | | using CefSharp.WinForms; |
| | | using System; |
| | | using System.Configuration; |
| | | using System.IO; |
| | |
| | | |
| | | private void ShowFile_Load(object sender, EventArgs e) |
| | | { |
| | | string _h5 = GetFileType(urlPath); |
| | | string _url = WebApiUrl + "upload/" + _h5 + "?filePath=" + urlPath + "&mid=" + Guid.NewGuid().ToString(); |
| | | string filePath = System.Uri.EscapeUriString(urlPath); |
| | | string fileType = GetFileType(urlPath); |
| | | string _url = WebApiUrl + "upload/h5/site.html?fileType=" + fileType + "&filePath=" + filePath + "&mid=" + Guid.NewGuid().ToString(); |
| | | chromeBrowser = new ChromiumWebBrowser(_url); |
| | | this.pane1.Controls.Add(chromeBrowser); |
| | | chromeBrowser.Dock = DockStyle.Fill; |
| | |
| | | case ".jpg": |
| | | case ".jpeg": |
| | | case ".png": |
| | | return "h5Image.html"; |
| | | return "img"; |
| | | case ".pdf": |
| | | return "h5Pdf.html"; |
| | | // 添加其他文件类型 |
| | | // ... |
| | | return "pdf"; |
| | | case ".mp4": |
| | | return "mp4"; |
| | | default: |
| | | return "h5Other.html"; |
| | | return "other"; |
| | | } |
| | | } |
| | | } |