Search code examples
c#sharepoint-2010

How to get the Microsoft Template folder using C#


How to get following sample folder path using c#?

C:\Users\User-Name-A1\AppData\Roaming\Microsoft\Templates

This can be different on different computers, in this case how to do this?

Can somebody help me sample code?


Solution

  • Use:

    Environment.GetFolderPath(Environment.SpecialFolder.Templates)