我正在尝试创建一个有效的 URL:private string Urlpath { get; set; }Driver.Navigate().GoToUrl(Urlpath); private void Button_URL(object sender, RoutedEventArgs e) { var dialog = new MyDialog(); if (dialog.ShowDialog() == true) { MessageBox.Show("Refreshing a URL requires you to select a folder."); string Urlpath = dialog.ResponseText; Status_HTML.Content = "Selected:" + "\n" + Urlpath + "\n" + "Save and/or edit any file in your folder to get started!"; } }Urlpath 是来自输入框中的字符串值,例如http://localhost/laravel/project/public/但它表示它不是有效的 url。实际上它说System.ArgumentNullException: Argument 'url' cannot be null。因为它可能只接受有效的 Urls 但有一个字符串值。如何将此字符串转换为 URL?
1 回答
- 1 回答
- 0 关注
- 133 浏览
添加回答
举报
0/150
提交
取消