How to reference the C:\Users\Public directory programmatically in C#

前端 未结 6 908
日久生厌
日久生厌 2021-01-04 00:33

Is it safe to programmatically reference the public folder through:

Directory = System.Environment.GetEnvironmentVariable(\"public\")+\"MyCompanyName\" // et         


        
6条回答
  •  执笔经年
    2021-01-04 00:53

    Have you looked at this ?

    http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx

    Specifies enumerated constants used to retrieve directory paths to system special folders.

    Ie

    Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData)
    

提交回复
热议问题