C# Block Directory Access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alexis4
    New Member
    • Dec 2009
    • 113

    C# Block Directory Access

    Hi!

    Let's say I have a directory at C:\MyDirectory. As long as my application runs, I want nobody to have access there, not even to see it's contents. Is this possible?

    Thanks in advance!
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    At best you can could change it's attribute to invisible.
    But if the user has their PC FolderOptions set to show invisible items then it would still be seen.

    Not having a folder be seen is really a means to an end... what is the end goal? Not not have files opened/deleted/added, for example?

    Comment

    • alexis4
      New Member
      • Dec 2009
      • 113

      #3
      I am developing a full screen mode project for a public PC, and I want the windows key (along with all hotkeys) to be disabled. I have been searching the internet for the past days, but most people say that this cannot be done and some solutions I checked out do not work for the specific key. I always believe that anything can be done in Windows, so I am searching of alternative ways to do that. I did it with all other hotkeys, using indirect ways in some of them. Thus I am looking for a way to lock start menu folder. I don't know if this is going to work, but I have to try...

      Comment

      • Dheeraj Joshi
        Recognized Expert Top Contributor
        • Jul 2009
        • 1129

        #4
        You want to even block Ctrl+Alt+Delete .....? That do not a good idea....

        I suppose you can not block all hot keys..

        Regards
        Dheeraj Joshi

        Comment

        • alexis4
          New Member
          • Dec 2009
          • 113

          #5
          Well I do not know if Ctrl+Alt+Delete will be blocked, but I am in position to do that anyway. Propably I will say to the client that I am not going to deactivate taskmanager whether he wants it or not, because I know the risk of doing that. But the windows start key (together with CTRL+ESC that also opens the start menu) is something else and I can't deactivate them. I can't find anything wrong with unauthorized access prevention to start menu and just hiding the taskbar does not prevent that. This is why I thought of windows start folder blocking.

          Comment

          • tlhintoq
            Recognized Expert Specialist
            • Mar 2008
            • 3532

            #6
            This is for some sort of "public pc" like at kiosk or internet cafe, right?
            So you have total control over what is installed and how it is configured, right?
            If you are worried about guests starting applications from the start menu, then clear out the start menu so it is empty.

            Otherwise, it might just be better to close the taskbar all together.

            Or perhaps your kiosk application should simply be full screen and top-most so nothing other than your application can be seen or accessed.

            Or put a two-head video card in the PC. Make the primary screen the one the guest doesn't see (and doesn't even have a monitor unless a service tech brings it with them). Give the guest the second screen where their permitted software is already configured to open.

            Don't get tunnel-vision. You can spend weeks looking for solution 'a', or you can fall back, look at the problem from another angle and find a way to impliment solution 'b' in a couple hours.

            Comment

            • alexis4
              New Member
              • Dec 2009
              • 113

              #7
              tlhintoq,

              Thanks for the tips. My application is full screen and top-most and the taskbar is hidden, but start menu proves to be a real pain in the ***! I don't think that clearing the start menu is actually my responsibility, but the two-head video card could be an option.
              However I strongly believe that if I could just deactivate the application that runs start menu with a file stream or something, the job could be done! If it is actually an application and not just a file open.

              Thanks again!

              Comment

              • GaryTexmo
                Recognized Expert Top Contributor
                • Jul 2009
                • 1501

                #8
                I wonder if this would help....



                I found that article a while back when I was making my friend a click counter. Perhaps it will allow you to detect when various keys (like the windows key, or control-escape) are pressed and take some kind of action?

                Also, and I don't know, but what would happen if you overrode the WinProc method on your form and checked which messages get triggered when you press those buttons?

                I really don't know the solution, I'm just throwing out ideas :)

                Comment

                • alexis4
                  New Member
                  • Dec 2009
                  • 113

                  #9
                  That is a really good article GaryTexmo, I will try that out! As for the WinProc method, I never really used it, so I may take a look there also and get my hands dirty if I have to!

                  Comment

                  Working...