C#-windows Service to LocalSystem mega I can't get my file path.

Source: Internet
Author: User

If window service is installed on the account above, it can not obtain the following path:

System.Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments)

Solution:

1. Change the LocalSystem to user, then compile the installer and fill in the current login user's account information when installing.

Resources:

The Account property value of the ServiceProcessInstaller class can be any value of the Serviceacount enumeration, as shown in table 2

value

    Set this value to specify the user account for which the service uses high privileges on the local system, but this account allows anonymous users to enter the network. So it doesn't have permissions on the network
& nbsp;   This account type provides computer certificates to any remote server
    is similar to LocalService, which specifies that the computer's certificate is transferred to the remote server, but unlike LocalSystem, This service can be   as a non-authorized user;
    Log on to the local system. As the name implies, this account can only be used for services that need access to resources from the network
  User     Set the Account property to Serviceaccount.user, which means that you can specify the accounts that should be used in the service

C#-windows service to LocalSystem mega you can't get my files path

.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.