dcsimg
Results 1 to 3 of 3
  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2018
    Posts
    16

    access to the path is denied

    Hi,
    I am attempting to save a listbox's data to a text file. I have the correct coding however i got this error message
    System.UnauthorizedAccessException: 'Access to the path "my path name here" is denied'
    i am the only user on my laptop and admin so i dont understand the issue. I definitely have full access to the folder
    Thanks.

  2. #2
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,056

    Re: access to the path is denied

    You clearly don't though. Being logged in as admin since Vista is not the same as an admin account on XP. Your application needs to be running as admin.

    You need to edit the app.manifest

    Code:
    <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

  3. #3
    Fanatic Member PlausiblyDamp's Avatar
    Join Date
    Dec 2016
    Location
    Newport, UK
    Posts
    784

    Re: access to the path is denied

    Which folder where you trying to save to? It is generally better to save data to a location that doesn't require admin rights, depending on whether the data is meant to be accessed by a person or just your application you should consider storing it in either the "My Documents" or "Program Data" - https://msdn.microsoft.com/en-us/lib...or=-2147217396 gives an easy way of locating these places as well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width


×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.