Click here to Skip to main content
15,890,609 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to Reslove Error? Pin
dongodu25-May-11 3:13
dongodu25-May-11 3:13 
AnswerRe: How to Resolve Error? Pin
Luc Pattyn25-May-11 3:14
sitebuilderLuc Pattyn25-May-11 3:14 
AnswerRe: How to Reslove Error? Pin
_Erik_25-May-11 3:45
_Erik_25-May-11 3:45 
AnswerRe: How to Reslove Error? Pin
Eddy Vluggen25-May-11 4:31
professionalEddy Vluggen25-May-11 4:31 
QuestionRe: How to Resolve Error? Pin
Luc Pattyn25-May-11 5:38
sitebuilderLuc Pattyn25-May-11 5:38 
GeneralRe: How to Reslove Error? Pin
Dave Kreskowiak25-May-11 6:13
mveDave Kreskowiak25-May-11 6:13 
GeneralRe: How to Reslove Error? Pin
Eddy Vluggen25-May-11 11:41
professionalEddy Vluggen25-May-11 11:41 
QuestionProblem deleting a file (being used by another process) Pin
Central_IT25-May-11 1:55
Central_IT25-May-11 1:55 
Hi,

I get the following message when I try and delete a file.

"System.IO.IOException - The process cannot access the file 'filename' because it is being used by another process."

My cut down code is as follows

Dim aryFi As IO.FileInfo() = diFolder.GetFiles("*.pdf")
For Each fi In aryFi
sFileName = fi.Name
fi.delete
Next

Basically what I am doing is that depending what file is in the folder, delete it once I get various information about it that file. The above code is a cut down version. What other way would you delete a file or is this the best way. If so, what am I doing wrong.

Thanks in advance.

modified on Wednesday, May 25, 2011 8:30 AM

AnswerRe: Problem deleting a file (being used by another process) Pin
Dave Kreskowiak25-May-11 3:02
mveDave Kreskowiak25-May-11 3:02 
AnswerRe: Problem deleting a file (being used by another process) Pin
Luc Pattyn25-May-11 3:13
sitebuilderLuc Pattyn25-May-11 3:13 
GeneralRe: Problem deleting a file (being used by another process) Pin
Nagy Vilmos26-May-11 0:15
professionalNagy Vilmos26-May-11 0:15 
AnswerRe: Problem deleting a file (being used by another process) Pin
Luc Pattyn26-May-11 0:22
sitebuilderLuc Pattyn26-May-11 0:22 
QuestionVB.NET Progress status while run a EXE file Pin
Andraw Tang24-May-11 4:26
Andraw Tang24-May-11 4:26 
AnswerRe: VB.NET Progress status while run a EXE file Pin
Dave Kreskowiak24-May-11 4:31
mveDave Kreskowiak24-May-11 4:31 
AnswerRe: VB.NET Progress status while run a EXE file Pin
Luc Pattyn24-May-11 4:37
sitebuilderLuc Pattyn24-May-11 4:37 
GeneralRe: VB.NET Progress status while run a EXE file Pin
Andraw Tang24-May-11 5:10
Andraw Tang24-May-11 5:10 
GeneralRe: VB.NET Progress status while run a EXE file Pin
Andraw Tang24-May-11 6:52
Andraw Tang24-May-11 6:52 
AnswerRe: VB.NET Progress status while run a EXE file Pin
Luc Pattyn24-May-11 7:05
sitebuilderLuc Pattyn24-May-11 7:05 
GeneralRe: VB.NET Progress status while run a EXE file Pin
Andraw Tang24-May-11 7:24
Andraw Tang24-May-11 7:24 
Answerthere probably is a mistake somewhere Pin
Luc Pattyn24-May-11 7:42
sitebuilderLuc Pattyn24-May-11 7:42 
GeneralRe: there probably is a mistake somewhere [modified] Pin
Andraw Tang24-May-11 8:13
Andraw Tang24-May-11 8:13 
GeneralRe: there probably is a mistake somewhere Pin
Luc Pattyn24-May-11 8:38
sitebuilderLuc Pattyn24-May-11 8:38 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 9:01
Andraw Tang24-May-11 9:01 
GeneralRe: there probably is a mistake somewhere Pin
Dave Kreskowiak24-May-11 8:41
mveDave Kreskowiak24-May-11 8:41 
GeneralRe: there probably is a mistake somewhere Pin
Andraw Tang24-May-11 9:04
Andraw Tang24-May-11 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.