private void button1_Click(object sender, EventArgs e) { //AddBookmarkWindow bookmarkWindow = new AddBookmarkWindow(); //bookmarkWindow.Show(); //return; user = new KeyValuePair <string, string>(textBox2.Text, textBox1.Text); url = ((FileExplorerWindow.UrlLocation)comboBox1.SelectedItem); // url = new KeyValuePair<string, string>(((UrlLocation)comboBox1.SelectedItem).BaseAddress, String.Format(((UrlLocation)comboBox1.SelectedItem).Url, textBox2.Text)); using (HttpClient client = FileExplorerWindow.CreateHttpClient(url.BaseAddress, user)) if (FileExplorerWindow.CheckIfExists(new FileExplorerWindow.HttpInfo(client, new FileExplorerWindow.LinkInfo(String.Format(url.Url, textBox2.Text), url, url.FolderName, "Directory", null, "Directory"), user))) { DialogResult = DialogResult.OK; this.Close(); } else { MessageBox.Show("Username and/or Password Were Incorrect.\nPlease Try Again...", "Invalid Login"); } }