在这种情况下,我选择了一个目录,并在我的 label4 中看到了我选择的目录名称:
private void button2_Click(object sender, EventArgs e)
{
this.folderBrowserDialog1.Description = "Select the directory that you are want to use as default and please verify if the chosen directory is accessible";
if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
string message = "Are you sure you want to select this directory ?";
string caption = "Operation cancelled";
MessageBoxButtons buttons = MessageBoxButtons.YesNo;
DialogResult result;
result = MessageBox.Show(message, caption, buttons);
if (result == System.Windows.Forms.DialogResult.Yes)
{
mainUrl = folderBrowserDialog1.SelectedPath;
label4.Text = mainUrl;
}
}
}
但我想要一些相同的想法,但要输入一个网站链接地址。例如,当用户单击按钮时,它将打开一些文本框或其他东西。然后,用户将输入一个网站地址或粘贴一个链接并单击它会要求确认,然后在 label4 中拍摄。