Click here to Skip to main content
16,008,299 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to fire the DropDownList.SelectedIndexChanged event Pin
Dave Kreskowiak19-Nov-09 3:40
mveDave Kreskowiak19-Nov-09 3:40 
QuestionPermission Denied while Deleting Temporary Files Pin
Nash - ThE cOdE sLiZeR17-Nov-09 17:59
Nash - ThE cOdE sLiZeR17-Nov-09 17:59 
AnswerRe: Permission Denied while Deleting Temporary Files Pin
The Man from U.N.C.L.E.17-Nov-09 20:58
The Man from U.N.C.L.E.17-Nov-09 20:58 
GeneralRe: Permission Denied while Deleting Temporary Files Pin
Nash - ThE cOdE sLiZeR17-Nov-09 21:54
Nash - ThE cOdE sLiZeR17-Nov-09 21:54 
GeneralRe: Permission Denied while Deleting Temporary Files Pin
Shameel17-Nov-09 22:18
professionalShameel17-Nov-09 22:18 
GeneralRe: Permission Denied while Deleting Temporary Files Pin
Nash - ThE cOdE sLiZeR17-Nov-09 22:42
Nash - ThE cOdE sLiZeR17-Nov-09 22:42 
GeneralRe: Permission Denied while Deleting Temporary Files Pin
Shameel18-Nov-09 7:01
professionalShameel18-Nov-09 7:01 
AnswerRe: Permission Denied while Deleting Temporary Files Pin
Luc Pattyn17-Nov-09 23:30
sitebuilderLuc Pattyn17-Nov-09 23:30 
Here is what is probably troubling you, BTW it uses some .NET terms but that isn't really relevant, the crux of the matter holds true in any language on a Windows system:

if you want write or delete access (anything other than read access) to a file that just got created (by yourself or someone else, does not matter), chances are you will find the file is being accessed by some other process, and your access is not granted.

The other process very likely is some server code that is there to assist you somehow. Candidates are:
- anti-virus software (Norton, McAfee, whatever)
- indexing software (Google Desktop, MS Office, whatever)
The common thing is these packages are looking all the time for new files, so they can inspect them.

Microsoft is aware of the consequences; Windows Explorer will try rename and delete attempts up to five times (with one-second interval), and only reports failure if the action continues to fail for that time.

The solution:
1. either use a different file name (not always acceptable)
2. or remove all background reader candidates (bad idea)
3. or implement the retry loop as Explorer has it (use a Windows.Forms.Timer for this)

BTW: if all you need is Read, make sure to allow others to read as well, i.e.
use File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read)

Remark: in my experience, trying to open/append/close a file more often than once a second succeeds all the time, seems like the inspectors allow for at least one second of inactivity before opening the files themselves.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


GeneralRe: Permission Denied while Deleting Temporary Files Pin
Nash - ThE cOdE sLiZeR17-Nov-09 23:34
Nash - ThE cOdE sLiZeR17-Nov-09 23:34 
QuestionDistingush between OleDate and Double while extract the Contents in Excel. Pin
janaswamy uday17-Nov-09 4:27
janaswamy uday17-Nov-09 4:27 
AnswerRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Dave Kreskowiak17-Nov-09 5:39
mveDave Kreskowiak17-Nov-09 5:39 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. [modified] Pin
janaswamy uday17-Nov-09 6:00
janaswamy uday17-Nov-09 6:00 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Dave Kreskowiak17-Nov-09 8:31
mveDave Kreskowiak17-Nov-09 8:31 
AnswerRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Richard MacCutchan17-Nov-09 6:33
mveRichard MacCutchan17-Nov-09 6:33 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
janaswamy uday17-Nov-09 15:37
janaswamy uday17-Nov-09 15:37 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Dave Kreskowiak17-Nov-09 16:40
mveDave Kreskowiak17-Nov-09 16:40 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Rudheesh17-Nov-09 18:44
Rudheesh17-Nov-09 18:44 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Richard MacCutchan17-Nov-09 21:30
mveRichard MacCutchan17-Nov-09 21:30 
GeneralRe: Distingush between OleDate and Double while extract the Contents in Excel. Pin
Dave Kreskowiak18-Nov-09 2:07
mveDave Kreskowiak18-Nov-09 2:07 
QuestionVariable number of loop nesting Pin
cstrader23217-Nov-09 3:33
cstrader23217-Nov-09 3:33 
AnswerRe: Variable number of loop nesting Pin
Luc Pattyn17-Nov-09 3:51
sitebuilderLuc Pattyn17-Nov-09 3:51 
AnswerRe: Variable number of loop nesting Pin
dan!sh 17-Nov-09 3:57
professional dan!sh 17-Nov-09 3:57 
GeneralRe: Variable number of loop nesting Pin
cstrader23218-Nov-09 0:55
cstrader23218-Nov-09 0:55 
GeneralRe: Variable number of loop nesting Pin
dan!sh 18-Nov-09 3:11
professional dan!sh 18-Nov-09 3:11 
QuestionHow the Windows password at run-time get؟ Pin
Milad.Biroonvand17-Nov-09 3:27
Milad.Biroonvand17-Nov-09 3:27 

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.