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
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. process file handles

process file handles

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharpcomjson
5 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
    Arkett
    wrote on last edited by
    #1

    I'm trying to find a way of getting a list of files which are locked by other processes. I'm sure this can be done in .net without resorting to win32 api calls, but without spending days drilling into MSDN I'm hoping that someone already has an answer for vb.net 2.0 if poss. http://www.ViSYNERGY.com End of Line.

    D A 2 Replies Last reply
    0
    • A Arkett

      I'm trying to find a way of getting a list of files which are locked by other processes. I'm sure this can be done in .net without resorting to win32 api calls, but without spending days drilling into MSDN I'm hoping that someone already has an answer for vb.net 2.0 if poss. http://www.ViSYNERGY.com End of Line.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      Arkett wrote:

      I'm sure this can be done in .net without resorting to win32 api calls

      No, it can't. There is no support built into the .NET BCL to do anything close to this. You MUST start calling into Win32. I take it you've already found an example and didn't like what you saw? Dave Kreskowiak Microsoft MVP - Visual Basic

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        Arkett wrote:

        I'm sure this can be done in .net without resorting to win32 api calls

        No, it can't. There is no support built into the .NET BCL to do anything close to this. You MUST start calling into Win32. I take it you've already found an example and didn't like what you saw? Dave Kreskowiak Microsoft MVP - Visual Basic

        A Offline
        A Offline
        Arkett
        wrote on last edited by
        #3

        Please don't reply to this thread telling me what I can't do if you're not going to follow it up by telling me what I can do. It's just a waste of your time and mine. http://www.ViSYNERGY.com End of Line.

        D 1 Reply Last reply
        0
        • A Arkett

          Please don't reply to this thread telling me what I can't do if you're not going to follow it up by telling me what I can do. It's just a waste of your time and mine. http://www.ViSYNERGY.com End of Line.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Arkett wrote:

          Please don't reply to this thread telling me what I can't do if you're not going to follow it up by telling me what I can do.

          First, you haven't answered my question in my original reply. Second, I did at least partially answer your question. There is absolutely no support in the .NET Framework for what you want to do. Now, having said that, it narrows down your search parameters. Lastly, sorry, but I must have left out the part about "Now you can Google for it yourself using the narrowed down parameters of "process open files"! Dave Kreskowiak Microsoft MVP - Visual Basic

          1 Reply Last reply
          0
          • A Arkett

            I'm trying to find a way of getting a list of files which are locked by other processes. I'm sure this can be done in .net without resorting to win32 api calls, but without spending days drilling into MSDN I'm hoping that someone already has an answer for vb.net 2.0 if poss. http://www.ViSYNERGY.com End of Line.

            A Offline
            A Offline
            Arkett
            wrote on last edited by
            #5

            This has been something of an object lesson in futility. At the beginging of this exploration I had entertained hopes for the system.diagnostics.process class, but I now know that although I can get a good deal of information about running processes, including a handles count, a list of open file handles is not available. More research has concluded that the functionality I'm trying to expose in my programme is only available via the NT Native API, which is way beyond the scope of anything I can hope to achieve at the moment. I have spent two days googling till I'm blue in the mouth and trawling up and down inside MSDN and got nowhere. I did however get a few insights into some interesting things which may well be useful in the future, so it hasn't been a complete waste of time. Thanks to Dave Kreskowiak for - well nothing very much. TTFN http://www.ViSYNERGY.com End of Line.

            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