Need help checking the file path if empty, if the file exists, if the file is being used by another process

  • Thread starter Thread starter anonymous_3210
  • Start date Start date
A

anonymous_3210

Guest
Hello there,

Here is my code which selects the path. and displays in the textbox


private void button4_Click(object sender, EventArgs e)
{
OpenFileDialog openFileDialog1 = new OpenFileDialog();
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string strfilename = openFileDialog1.FileName;
textBox1.Text = strfilename;
}
}

private void textBox1_TextChanged(object sender, EventArgs e)
{
string directoryPath = Path.GetDirectoryName(filePath);
}

While selecting a file, if the user selects null or empty I want to give a popup "please select the file" and a popup if the file already exists and one more popup if the file is already being used .


Akshay

Continue reading...
 
Back
Top