networking - VB.NET Copy file to network share - The network path was not found -


i can copy file long network mapped path active. randomly goes inactive. have 3 users testing right - 1 user has no issues, 1 had no issues until halfway through day , 1 user failed on first try.

is there way ping network share until connected, copy? haven't attempted code yet, i'm not sure look. google results don't fit bill.

thanks help!

i wonder if fails because doesn't connect in time (you make request file, windows it's stuff re-connect, 'network path not found' because timed out).

if case (and acceptable you), try/catch , try again few times (though hacky, might work). can (and maybe should) put in check first see's if network drive available (you can use system.io.directory see if remote directory exists).

(edited) - here example try few times:

    dim counter integer = 0      ' loop few times     while counter < 3         try             system.io.file.copy("c:\test.txt", "c:\test1.txt")             exit while         catch ex exception             ' can pause here specified amount, can report             ' exception, can nothing         end try          counter += 1     end while 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -