我对CefSharp浏览器不是很熟悉,所以需要外部帮助。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CefSharp;
using CefSharp.WinForms;
using System.Runtime.InteropServices;
using Microsoft.Win32;
namespace WindowsFormsApplication7
{
public partial class debug : Form
{
public ChromiumWebBrowser browser;
public debug()
{
InitializeComponent();
InitBrowser();
}
private void debug_Load(object sender, EventArgs e)
{
}
public void InitBrowser()
{
Cef.Initialize(new CefSettings());
browser = new ChromiumWebBrowser("https://whatismyipaddress.com/");
this.Controls.Add(browser);
browser.Dock = DockStyle.Fill;
CefSettings cfsettings = new CefSettings();
cfsettings.CefCommandLineArgs.Add("proxy-server", "200.29.191.149:3128");
cfsettings.UserAgent = "My/Custom/User-Agent-AndStuff";
Cef.Initialize(cfsettings);
}
}
}
这是我的当前代码。我希望它使用代理,我已经谷歌了过去的3个小时。时间已经很晚了,所以我希望有人能帮我将代理插入其中。