因此,我设置代码的方式会在显示表单之前加载ChromeDriver。我需要驱动程序是全局的,因此我不确定如何处理。当前代码:
public partial class Form1 : Form
{
DiscordSocketClient Client;
IWebDriver driver = new ChromeDriver();
string homeURL;
string[,] betData = new string[15, 50];
int totalRows = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
cbDiscordChannel.SelectedIndex = 1;
ConnectToDiscord();
}