Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Accessing File

Accessing File

Scheduled Pinned Locked Moved Visual Basic
mcptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AliAmjad
    wrote on last edited by
    #1

    Can anyone please give me a hint how to check whether a file i being accessed by another process or not, so that i can open it for manipulation. Thanks in advance!

    AliAmjad(MCP) First make it Run THEN make it Run Fast!

    A 1 Reply Last reply
    0
    • A AliAmjad

      Can anyone please give me a hint how to check whether a file i being accessed by another process or not, so that i can open it for manipulation. Thanks in advance!

      AliAmjad(MCP) First make it Run THEN make it Run Fast!

      A Offline
      A Offline
      alx n
      wrote on last edited by
      #2

      Private Function isFileInUse(ByVal sFileName As String) As Boolean Dim nFileNum As Integer ' If the file is already opened by another process and the specified type of access ' is not allowed the Open operation fails and an error occurs. Try nFileNum = FileSystem.FreeFile() FileSystem.FileOpen(nFileNum, sFileName, OpenMode.Binary, OpenAccess.Read, OpenShare.LockReadWrite) FileSystem.FileClose(nFileNum) Catch Return True End Try Return False End Function

      alex_nel

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups