vb.net - System.IO.IOException: The process cannot access the file because it is being used by another process -


in before, have checked fileinfo isn't filestream, there no need close file after being used. however, have encountered error when try run method twice. , found out message caused due file.copyto(_fulldestpath , true). how resolve error message?

public function copyfiles(_fullpath string, _dest string) string      dim destpath string = _dest      if not directory.exists(destpath)         directory.createdirectory(destpath)     end if     scribe.displaymessage("hello")     ' dim file = new fileinfo("\\200.1.1.32\export\2016\11\01000001mp201611.pdf")     dim file = new fileinfo(_fullpath)     scribe.displaymessage("hello 2")     dim _fulldestpath = path.combine(destpath, file.name)     scribe.displaymessage("hello 3")     file.copyto(_fulldestpath, true)     scribe.displaymessage("hello 4")      return _fulldestpath end function 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -