Click here to Skip to main content
15,883,809 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to check file is open or not from specific folder.
Posted
Updated 1-Jan-23 19:10pm
v2

private void status_Click(object sender, EventArgs e)
{
string filepath = textBox1.Text;

try
{
using (Stream stream = new FileStream(textBox1.Text, FileMode.Open))
{

MessageBox.Show("file is open");
}
}
catch
{
MessageBox.Show("file not open");
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900