0

I display the files in a directory with Directory.GetFiles() and then,

Dim readText() As String = File.ReadAllLines(file)

But I have an error that says:

The process cannot access the file because it is being used by another process.

Do you know how to check if a file is already used by a process?

I'm looking for a one-line solution.

Sunil
  • 3,404
  • 10
  • 23
  • 31
Elddif
  • 71
  • 1
  • 10

0 Answers0