【问题标题】:I can't load a link from a textBox c#我无法从文本框 c# 加载链接
【发布时间】:2022-01-02 05:24:15
【问题描述】:

关键是我希望能够将链接粘贴到文本框,单击按钮后,我希望加载此链接。我不知道该怎么做太多了

   public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
            string url = textBox1;
            ChromeDriver driver;
            Thread th;
            private void Form1_Load(object sender, EventArgs e)
            {
                ChromeOptions options = new ChromeOptions();
                options.AddArguments("--disable-notifications");
                driver = new ChromeDriver(options);
                driver.Navigate().GoToUrl(url);

【问题讨论】:

  • 你的按钮有事件处理程序吗?其次,从文本框中获取文本的方法是使用Text 属性:例如textBox1.Text

标签: c# string selenium-webdriver url selenium-chromedriver


【解决方案1】:

改变

string url = textBox1;

string url = textBox1.Text;

【讨论】:

    猜你喜欢
    • 2012-10-28
    • 1970-01-01
    • 1970-01-01
    • 2010-09-24
    • 2019-11-13
    • 2018-01-28
    • 2020-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多