Click here to Skip to main content
15,905,068 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: when does the Sub application_start know when to start? Pin
Christian Graus21-Feb-06 17:17
protectorChristian Graus21-Feb-06 17:17 
GeneralRe: when does the Sub application_start know when to start? Pin
kenn_rosie21-Feb-06 18:05
kenn_rosie21-Feb-06 18:05 
GeneralRe: when does the Sub application_start know when to start? Pin
Divya Rathi22-Feb-06 3:48
Divya Rathi22-Feb-06 3:48 
QuestionDetect the file is opened or not? Pin
cylix200021-Feb-06 14:49
cylix200021-Feb-06 14:49 
AnswerRe: Detect the file is opened or not? Pin
Christian Graus21-Feb-06 15:51
protectorChristian Graus21-Feb-06 15:51 
GeneralRe: Detect the file is opened or not? Pin
cylix200021-Feb-06 16:29
cylix200021-Feb-06 16:29 
GeneralRe: Detect the file is opened or not? Pin
Christian Graus21-Feb-06 16:30
protectorChristian Graus21-Feb-06 16:30 
AnswerRe: Detect the file is opened or not? Pin
japel21-Feb-06 18:32
japel21-Feb-06 18:32 
Catching the Exception is the only way to get feedback that a file is open and can not be moved...

What you need to do is loop throuhg the files you are moving and when it hits a locked file it keeps trying till it can.

<br />
      Dim bIOEx As Boolean = True<br />
      Try<br />
          If blnMove = True Then<br />
              Do<br />
                  Try<br />
                      System.IO.File.Move(strOriginalFile, strDestinationFile)<br />
                      bIOEx = False<br />
 <br />
                  Catch ex As IOException<br />
                      bIOEx = True<br />
                  End Try<br />
              Loop Until bIOEx = False<br />
          End If<br />
      Catch ex As Exception<br />
          MessageBox.Show("The File Redirection Failed" & vbCrLf & ex.Message, "Move Error", MessageBoxButtons.OK, MessageBoxIcon.Warning)<br />
      Finally<br />
          blnMove = False<br />
      End Try<br />


You may want to do a loop count that times out after 3 tries 10 seconds apart.

Hope this helps...

When people make you see red, be thankful your not colour blind.
QuestionWhat object is streamwriter located under? Pin
kenn_rosie21-Feb-06 13:00
kenn_rosie21-Feb-06 13:00 
AnswerRe: What object is streamwriter located under? Pin
progload21-Feb-06 13:37
progload21-Feb-06 13:37 
GeneralRe: What object is streamwriter located under? Pin
kenn_rosie21-Feb-06 13:49
kenn_rosie21-Feb-06 13:49 
GeneralRe: What object is streamwriter located under? Pin
progload21-Feb-06 14:36
progload21-Feb-06 14:36 
GeneralRe: What object is streamwriter located under? Pin
kenn_rosie21-Feb-06 14:51
kenn_rosie21-Feb-06 14:51 
QuestionServer &amp; Client Pin
ADY00721-Feb-06 12:25
ADY00721-Feb-06 12:25 
QuestionCreateObject("WindowsInstaller.Installer") Error Pin
Sysdoc262821-Feb-06 12:18
Sysdoc262821-Feb-06 12:18 
Questioncreating multiple dataset based on query Pin
uglyeyes21-Feb-06 12:00
uglyeyes21-Feb-06 12:00 
AnswerRe: creating multiple dataset based on query Pin
ne0h21-Feb-06 21:16
ne0h21-Feb-06 21:16 
QuestionVlookup function like excel Pin
Sergi2521-Feb-06 11:41
Sergi2521-Feb-06 11:41 
AnswerRe: Vlookup function like excel Pin
Ray Cassick21-Feb-06 11:48
Ray Cassick21-Feb-06 11:48 
QuestionInheritence, disallow ShowDialog() Pin
K. Shaffer21-Feb-06 8:59
K. Shaffer21-Feb-06 8:59 
AnswerRe: Inheritence, disallow ShowDialog() Pin
K. Shaffer21-Feb-06 9:09
K. Shaffer21-Feb-06 9:09 
QuestionVS 2003 to VS 2005 Crystal Reports Hell problems Pin
nordico2521-Feb-06 7:41
nordico2521-Feb-06 7:41 
QuestionCrystal reports via VB.Net Pin
directred21-Feb-06 7:29
directred21-Feb-06 7:29 
QuestionSending HTML emails with MAPI (VB6) Pin
ThePmanLives21-Feb-06 5:47
ThePmanLives21-Feb-06 5:47 
Questionsearching through a site Pin
teuneboon21-Feb-06 4:38
teuneboon21-Feb-06 4:38 

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.