Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
GeneralRe: enlarging picture box Pin
rzvme4-Oct-06 9:37
rzvme4-Oct-06 9:37 
QuestionRe: enlarging picture box Pin
rzvme4-Oct-06 23:42
rzvme4-Oct-06 23:42 
QuestionRemoting - interface vs proxy (soapsuds) Pin
Chuck Bevitt4-Oct-06 8:48
Chuck Bevitt4-Oct-06 8:48 
AnswerRe: Remoting - interface vs proxy (soapsuds) Pin
led mike4-Oct-06 10:17
led mike4-Oct-06 10:17 
Question3 state Button - weird behaviour Pin
seq-4-Oct-06 8:41
seq-4-Oct-06 8:41 
AnswerRe: 3 state Button - weird behaviour Pin
Christian Graus4-Oct-06 9:36
protectorChristian Graus4-Oct-06 9:36 
AnswerRe: 3 state Button - weird behaviour [modified] Pin
Ilíon4-Oct-06 9:59
Ilíon4-Oct-06 9:59 
Questionfile system watcher problem Pin
gus_br4-Oct-06 8:39
gus_br4-Oct-06 8:39 
i have done a handler for the file system watcher event.
ok, inside it, i wanna move a file (which generated the event) to another location, but when this event is fired the windows system is still copyng (which is worse) or moving the file in question and i can`t perform such task because the file is being used by another process (the windows system).
i have put a Thread.Sleep() in my code to wait for the copy, but it isn`t a cool way to solve this (it`s unpredictable). if i remove the Thread.Sleep() i`ll end up with an exception.
is there another way to solve this?

thanks

here`s the code snippet:

<br />
private void fileSystemWatcher_Created(object sender, System.IO.FileSystemEventArgs e)<br />
        {<br />
            try<br />
            {<br />
                if (pedido.CarregarArquivo(e.FullPath))<br />
                {<br />
                    System.Threading.Thread.Sleep(60000);<br />
                    if (File.Exists(Path.Combine(caminhoDestinoSucesso, e.Name)))<br />
                        File.Delete(Path.Combine(caminhoDestinoSucesso, e.Name));<br />
                    File.Move(e.FullPath, Path.Combine(caminhoDestinoSucesso, e.Name));<br />
                    <br />
                }<br />
                else<br />
                {<br />
                    System.Threading.Thread.Sleep(60000);<br />
<br />
                    if (File.Exists(Path.Combine(caminhoDestinoErro, e.Name)))<br />
                        File.Delete(Path.Combine(caminhoDestinoErro, e.Name));<br />
                    <br />
                    File.Move(e.FullPath, Path.Combine(caminhoDestinoErro, e.Name));   <br />
                }<br />
            }<br />
            catch (Exception ex)<br />
            {<br />
                MostrarMensagem(ex.Message, true);<br />
            }<br />
        }<br />

AnswerRe: file system watcher problem Pin
Andrew Rissing4-Oct-06 11:42
Andrew Rissing4-Oct-06 11:42 
GeneralRe: file system watcher problem Pin
gus_br4-Oct-06 14:04
gus_br4-Oct-06 14:04 
GeneralRe: file system watcher problem Pin
Andrew Rissing5-Oct-06 4:27
Andrew Rissing5-Oct-06 4:27 
GeneralRe: file system watcher problem Pin
gus_br6-Oct-06 7:03
gus_br6-Oct-06 7:03 
AnswerRe: file system watcher problem Pin
Andrew Rissing6-Oct-06 7:25
Andrew Rissing6-Oct-06 7:25 
QuestionDllImport / PInvoke Problem? Pin
David Knechtges4-Oct-06 8:18
David Knechtges4-Oct-06 8:18 
AnswerRe: DllImport / PInvoke Problem? Pin
Ed.Poore4-Oct-06 11:11
Ed.Poore4-Oct-06 11:11 
GeneralRe: DllImport / PInvoke Problem? Pin
David Knechtges5-Oct-06 7:32
David Knechtges5-Oct-06 7:32 
QuestionGTK# deployment - an installer project. Pin
P85Dyer4-Oct-06 7:47
P85Dyer4-Oct-06 7:47 
QuestionGrouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:14
tntomek4-Oct-06 7:14 
AnswerRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 7:17
LongRange.Shooter4-Oct-06 7:17 
GeneralRe: Grouping Array of Objects by Properties Pin
tntomek4-Oct-06 7:38
tntomek4-Oct-06 7:38 
AnswerRe: Grouping Array of Objects by Properties Pin
Nicholas Butler4-Oct-06 8:45
sitebuilderNicholas Butler4-Oct-06 8:45 
GeneralRe: Grouping Array of Objects by Properties Pin
LongRange.Shooter4-Oct-06 14:29
LongRange.Shooter4-Oct-06 14:29 
QuestionSorting a listview from an array. Pin
teejayem4-Oct-06 6:10
teejayem4-Oct-06 6:10 
AnswerRe: Sorting a listview from an array. Pin
aamironline4-Oct-06 6:38
aamironline4-Oct-06 6:38 
AnswerRe: Sorting a listview from an array. Pin
Eric Dahlvang4-Oct-06 6:39
Eric Dahlvang4-Oct-06 6:39 

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.