C# 윈폼 앱에 CefSharp 오프소스 웹브라우저를 사용하기
1) 윈폼 프로젝트 생성
2) NuGet ( Solution -> Configuration Manager , 프로젝트를 AnyCPU에서 x86 또는 x64로 변경)
- 직접 복사하는 방식은 해당 URL에서 참고
3) Form에 코드 추가하기 ( Form -> View Code)
using CefSharp; using CefSharp.WinForms;
public ChromiumWebBrowser browser; public void InitBrowser(){ Cef.Initialize(new CefSettings()); browser = new ChromiumWebBrowser ("www.google.com"); this.Controls.Add(browser); browser.Dock = DockStyle.Fill; }
public Form1() {//....InitializeComponent()InitBrowser()}
# GitHub
: https://github.com/cefsharp/CefSharp
CefSharp lets you embed Chromium in .NET apps. It is a lightweight .NET wrapper
around the Chromium Embedded Framework (CEF) by Marshall A. Greenblatt.
About 30% of the bindings are written in C++/CLI with the majority of code here is C#.
It can be used from C# or VB, or any other CLR language. CefSharp provides both WPF
and WinForms web browser control implementations.
https://cefsharp.github.io/
- Full Web Browser in your C# App
- HTML5, JavaScript and PDF supported
- Deep Integration
- Warp-drvice Performance
- Free and Open Source
- Multiple Flavors : CefSharp.WinForms, CefSharp.WPF
- Documented and Supported
원문 : http://www.codeproject.com/Tips/1058700/Embedding-Chrome-in-your-Csharp-App-using-CefSharp
'Application, App > Windows-C#(CSharp)' 카테고리의 다른 글
토렌트 다운로드중에 영화 시청하기 (0) | 2017.07.08 |
---|