regex pattern that takes only directory without file name
Code:
private void txtDownloadRoot_Validating(object sender, CancelEventArgs e)
        {
            Regex driveCheck = new Regex(@"([a-zA-Z]:\\[^/:\*;\/\:\?<>\|]+)|(\\{2}[^/:\*;\/\:\?<>\|]+)");
            if (!driveCheck.IsMatch(txtDownloadRoot.Text))
            {
                e.Cancel = true;
                txtDownloadRoot.Focus();
...