Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8892497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:00:51+00:00 2026-06-14T23:00:51+00:00

Hi i have a application that creat/write a Logfile (later it will write a

  • 0

Hi i have a application that creat/write a Logfile (later it will write a ErrorLog)
but at the moment i stick in to the permission problem because if the user havn’t the right to creat a File in the Folder where my app is it throws an exeption

now my question how do i get indipendent (from the user) creating and writing rights for this app

i read this but it doesn’t help because the client won’t be able to give that permissions
(they are not authorized) but i need that right for my app

your help will appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:00:52+00:00Added an answer on June 14, 2026 at 11:00 pm

    It’s a common conception (I would even say, a best practice) to have the program binaries separated from its data.

    All Windows app, for example, are located under Program files, but write their data either under user’s %APPDATA% for personal data or %ProgramData% for shared data. You should follow this guidelines, unless your program have very specific requirements.

    Depending on the kind of data, especially if you want the user to find quickly the data, you can also create a subfolder under user’s document folder.

    Using C#, you will be able to find easily of this special folders using Environment.GetFolderPath Method. For example:

    public string GetDataFolder()
    {
        var appDataPath = Environment.GetFolderPath(
            Environment.SpecialFolder.ApplicationData, // Search under %APPDATA%
            Environment.SpecialFolderOption.Create // Create the folder if it does not exists
        );
        var dataFolder = Path.Combine(
            appDataPath,
            "MyApplication"
        );
        return dataFolder;
    }
    

    If you look at the Environment.SpecialFolderOption Enumeration, you will see that most of the common places are easily be found.

    As you stated the data will be shared by all users, you should specifically targets %ProgramData%, which is found by using Environment.SpecialFolder.CommonApplicationData :

    The directory that serves as a common repository for application-specific data that is used by all users.

    Ultimately, this folder will be resolved as (with default settings) C:\Programdata\MyApplication.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an application server side that will create a pdf of a
I have an application that saves its streams not in its application directory, but
I have a c# simple application that have to write some values in a
I have an application that in a certain moment has to create a temporary
I have an application in which a user will be saving information that will
I have an application that performs a write to a database each time a
I have Winforms application that must create write to certain configuration file during usage.
I have an application that's built on top of Eventlet. I'm trying to write
I have an application that needs updating constantly. I would like to create a
I have a web application that allows users to create an account, and in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.