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. C# and file access permission failures on Windows 2000

C# and file access permission failures on Windows 2000

Scheduled Pinned Locked Moved C#
csharphelpdatabasedotnetquestion
5 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.
  • P Offline
    P Offline
    Parrish
    wrote on last edited by
    #1

    First off I'm new to this development platform so I don't know some of the most obvious fixes for known problems. Anyway, I've developed an application in C# that creates/accesses text files and utilizes the Microsoft Access database. My application runs fine on XP but fails with file access permission failures on Windows 2000 professional (the only other platform I've had access to to try). The .Net framework 1.1 is loaded on the machine and the application comes up with no problems. Only when I try to access a file I start having problems. Is there someting obvious I'm missing? Something particular to Windows 2000 I need to understand? I can't be the only one who has had this problem....can I? Any help/insight would be appreciated. Parrish

    D H 2 Replies Last reply
    0
    • P Parrish

      First off I'm new to this development platform so I don't know some of the most obvious fixes for known problems. Anyway, I've developed an application in C# that creates/accesses text files and utilizes the Microsoft Access database. My application runs fine on XP but fails with file access permission failures on Windows 2000 professional (the only other platform I've had access to to try). The .Net framework 1.1 is loaded on the machine and the application comes up with no problems. Only when I try to access a file I start having problems. Is there someting obvious I'm missing? Something particular to Windows 2000 I need to understand? I can't be the only one who has had this problem....can I? Any help/insight would be appreciated. Parrish

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

      Is your app running on the 2000 machine loaded from a network share on the XP machine? If so, that's where your problem is. Since the netowkr machine isn't a trusted server, your code will not have the same access to the system as if it were launched from the 2000 box. RageInTheMachine9532 "...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome

      P 1 Reply Last reply
      0
      • P Parrish

        First off I'm new to this development platform so I don't know some of the most obvious fixes for known problems. Anyway, I've developed an application in C# that creates/accesses text files and utilizes the Microsoft Access database. My application runs fine on XP but fails with file access permission failures on Windows 2000 professional (the only other platform I've had access to to try). The .Net framework 1.1 is loaded on the machine and the application comes up with no problems. Only when I try to access a file I start having problems. Is there someting obvious I'm missing? Something particular to Windows 2000 I need to understand? I can't be the only one who has had this problem....can I? Any help/insight would be appreciated. Parrish

        H Offline
        H Offline
        Heath Stewart
        wrote on last edited by
        #3

        Also (regarding what Dave said), the file permissions may be different. If your MDB (Jet Database, aka "Access database") is in a directory where you don't have write permissions, then you must change the permissions on that directory. If you're accessing the file over the network, then your code must have a FileIOPermission that allows access to that resource. This deals with Code Access Security in .NET - a sandbox of sorts that makes it a secure framework. See the article, Understanding .NET Code Access Security[^], for more information.

        Microsoft MVP, Visual C# My Articles

        P 1 Reply Last reply
        0
        • D Dave Kreskowiak

          Is your app running on the 2000 machine loaded from a network share on the XP machine? If so, that's where your problem is. Since the netowkr machine isn't a trusted server, your code will not have the same access to the system as if it were launched from the 2000 box. RageInTheMachine9532 "...a pungent, gastly, stinky piece of cheese!" -- The Roaming Gnome

          P Offline
          P Offline
          Parrish
          wrote on last edited by
          #4

          It's running on a Windows 2000 professional network. No XP involved at all. Thank you for your quick reply. Parrish

          1 Reply Last reply
          0
          • H Heath Stewart

            Also (regarding what Dave said), the file permissions may be different. If your MDB (Jet Database, aka "Access database") is in a directory where you don't have write permissions, then you must change the permissions on that directory. If you're accessing the file over the network, then your code must have a FileIOPermission that allows access to that resource. This deals with Code Access Security in .NET - a sandbox of sorts that makes it a secure framework. See the article, Understanding .NET Code Access Security[^], for more information.

            Microsoft MVP, Visual C# My Articles

            P Offline
            P Offline
            Parrish
            wrote on last edited by
            #5

            Thank you very much. I read up on it. Parrish

            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