Click here to Skip to main content
15,892,768 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: set picture as desktop wallpaper Pin
[Marc]29-Dec-05 15:43
[Marc]29-Dec-05 15:43 
QuestionProblems with detecting object type Pin
Hmmkk29-Dec-05 11:16
Hmmkk29-Dec-05 11:16 
GeneralRe: Problems with detecting object type Pin
Hmmkk29-Dec-05 12:01
Hmmkk29-Dec-05 12:01 
AnswerRe: Problems with detecting object type Pin
Dave Kreskowiak29-Dec-05 13:00
mveDave Kreskowiak29-Dec-05 13:00 
QuestionSQL - Convert String to Date Pin
dptalt29-Dec-05 10:35
dptalt29-Dec-05 10:35 
AnswerRe: SQL - Convert String to Date Pin
Michael Flanakin29-Dec-05 12:40
Michael Flanakin29-Dec-05 12:40 
QuestionProblems with File System Watcher and File.Copy() Pin
chiyinhk29-Dec-05 7:36
chiyinhk29-Dec-05 7:36 
AnswerRe: Problems with File System Watcher and File.Copy() Pin
Dave Kreskowiak29-Dec-05 12:48
mveDave Kreskowiak29-Dec-05 12:48 
chiyinhk wrote:
I guess the problem is with the File System Watcher.


No, it's with how your assuming it works.

The Created event fires when the fire is CREATED, not when it's finally full of data and the other app closes it.

Since the other application is still writing to the file, and most probably has an exclusive lock on it, you have to wait until the other process is finished with the file before you can copy it.

To do this, in the Created event, your code has to try to open the file for Exclusive Read (DenyShareAll). If the Open fails, you'll have to wait a couple of seconds, then try again. Keep doing this until the file opens.

When the file finally does open, you can either read the file and copy it yourself, or close the file, then immediately start the File.Copy just like you are now.


RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

QuestionWhat is wrong with this connectionstring definition? Pin
JUNEYT29-Dec-05 4:25
JUNEYT29-Dec-05 4:25 
AnswerRe: What is wrong with this connectionstring definition? Pin
Michael Flanakin29-Dec-05 5:21
Michael Flanakin29-Dec-05 5:21 
QuestionBinding dataset to a textbox Pin
y_mmohd29-Dec-05 0:15
y_mmohd29-Dec-05 0:15 
AnswerRe: Binding dataset to a textbox Pin
abhinish29-Dec-05 0:58
abhinish29-Dec-05 0:58 
AnswerRe: Binding dataset to a textbox Pin
vonb29-Dec-05 0:59
vonb29-Dec-05 0:59 
QuestionUTF-8 read and write back to Oracle DB from VB application corrupts the data[if-non-english char] to unreadable format Pin
22491728-Dec-05 22:22
22491728-Dec-05 22:22 
AnswerRe: UTF-8 read and write back to Oracle DB from VB application corrupts the data[if-non-english char] to unreadable format Pin
22491711-Jan-06 0:01
22491711-Jan-06 0:01 
QuestionCreate interface Pin
Kusal28-Dec-05 21:45
Kusal28-Dec-05 21:45 
AnswerRe: Create interface Pin
Dave Kreskowiak29-Dec-05 5:27
mveDave Kreskowiak29-Dec-05 5:27 
QuestionError: Exception has been thrown by the target of an invocation Pin
drexler_kk28-Dec-05 16:29
drexler_kk28-Dec-05 16:29 
AnswerRe: Error: Exception has been thrown by the target of an invocation Pin
Dave Kreskowiak28-Dec-05 16:40
mveDave Kreskowiak28-Dec-05 16:40 
GeneralRe: Error: Exception has been thrown by the target of an invocation Pin
drexler_kk28-Dec-05 17:02
drexler_kk28-Dec-05 17:02 
AnswerRe: Error: Exception has been thrown by the target of an invocation Pin
Gerben Jongerius28-Dec-05 20:45
Gerben Jongerius28-Dec-05 20:45 
GeneralRe: Error: Exception has been thrown by the target of an invocation Pin
drexler_kk28-Dec-05 21:40
drexler_kk28-Dec-05 21:40 
GeneralRe: Error: Exception has been thrown by the target of an invocation Pin
Dave Kreskowiak29-Dec-05 5:24
mveDave Kreskowiak29-Dec-05 5:24 
GeneralRe: Error: Exception has been thrown by the target of an invocation Pin
drexler_kk29-Dec-05 14:47
drexler_kk29-Dec-05 14:47 
GeneralRe: Error: Exception has been thrown by the target of an invocation Pin
tankSanju10-Jul-08 22:43
tankSanju10-Jul-08 22:43 

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.