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. C#
  4. Folder access

Folder access

Scheduled Pinned Locked Moved C#
csharpsysadminsecurityhelp
7 Posts 3 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.
  • N Offline
    N Offline
    NetRocker
    wrote on last edited by
    #1

    Hi, I am currently working on an encryption application. I created a windows service that watches over a directory and when a new file is added, it encrypts it. Now here is the problem :doh:. I want to find out which user has added a file to the directory (which is o n network). Is this possible to find out which user has dropped or added the file to the directory in C#. Thanks in advance -Sandeep .Net Developer

    M 1 Reply Last reply
    0
    • N NetRocker

      Hi, I am currently working on an encryption application. I created a windows service that watches over a directory and when a new file is added, it encrypts it. Now here is the problem :doh:. I want to find out which user has added a file to the directory (which is o n network). Is this possible to find out which user has dropped or added the file to the directory in C#. Thanks in advance -Sandeep .Net Developer

      M Offline
      M Offline
      Michael Hendrickx
      wrote on last edited by
      #2

      erm.. depending on the environment that you are using but.. ..the owner of the file? -- michael - www.code.ae

      N 1 Reply Last reply
      0
      • M Michael Hendrickx

        erm.. depending on the environment that you are using but.. ..the owner of the file? -- michael - www.code.ae

        N Offline
        N Offline
        NetRocker
        wrote on last edited by
        #3

        Hey Micheal, Its not the file owner. The managers want to know who has dropped the file for encryption. We want the user who dropped the file into the folder in a network.

        D 1 Reply Last reply
        0
        • N NetRocker

          Hey Micheal, Its not the file owner. The managers want to know who has dropped the file for encryption. We want the user who dropped the file into the folder in a network.

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

          This information doesn't exist anywhere. Usually, depending on the network O/S, the person who dropped the file becomes that copy of the file's owner. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          N 1 Reply Last reply
          0
          • D Dave Kreskowiak

            This information doesn't exist anywhere. Usually, depending on the network O/S, the person who dropped the file becomes that copy of the file's owner. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            N Offline
            N Offline
            NetRocker
            wrote on last edited by
            #5

            Thanks for the info. Is there a way to get the owner details from the file. I use windows XP.

            D 1 Reply Last reply
            0
            • N NetRocker

              Thanks for the info. Is there a way to get the owner details from the file. I use windows XP.

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

              Well, there's nothing in the .NET BCL that will do this, so alternate methods must be used. Here[^] is an example in VB.NET using WMI to get the owner. And here[^] is an example in C++. I wasn't able to find a straight c# example. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              N 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Well, there's nothing in the .NET BCL that will do this, so alternate methods must be used. Here[^] is an example in VB.NET using WMI to get the owner. And here[^] is an example in C++. I wasn't able to find a straight c# example. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

                N Offline
                N Offline
                NetRocker
                wrote on last edited by
                #7

                Hey Micheal, Thank you very much. I could convert the VB.NET code to C#. Instead of using WMI i used unmanaged code itself calling all the function manually. It summed up to 40lines code and works fine. Thank you very much for help

                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