Folder Paths Win Mac

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Here is a list of the system paths you can retrieve using System.Environment.SpecialFolder( #name goes here# ):
+
Here is a list of the system paths you can retrieve using System.Environment.GetFolderPath.
  
{| class="wikitable"
+
For example:
 +
<syntaxhighlight lang="csharp">
 +
System.Environment.GetFolderPath( System.Environment.SpecialFolder.ApplicationData )
 +
</syntaxhighlight>
 +
 
 +
<br/>
 +
 
 +
{| class="wikitable" cellpadding='2'
 
{{OSFolder| id=0  | name=Desktop | osx1068=/Users/yourname/Desktop | win7=C:\Users\yourname\Desktop }}
 
{{OSFolder| id=0  | name=Desktop | osx1068=/Users/yourname/Desktop | win7=C:\Users\yourname\Desktop }}
 
{{OSFolder| id=2  | name=Programs | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs }}
 
{{OSFolder| id=2  | name=Programs | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs }}
Line 16: Line 23:
 
{{OSFolder| id=21 | name=Templates | osx1068=/Users/yourname/Templates | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates }}
 
{{OSFolder| id=21 | name=Templates | osx1068=/Users/yourname/Templates | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates }}
 
{{OSFolder| id=26 | name=ApplicationData | osx1068=/Users/yourname/.config | win7=C:\Users\yourname\AppData\Roaming }}
 
{{OSFolder| id=26 | name=ApplicationData | osx1068=/Users/yourname/.config | win7=C:\Users\yourname\AppData\Roaming }}
{{OSFolder| id=28 | name=LocalApplicationData | osx1068=/Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share | win7=C:\Users\yourname\AppData\Local }}
+
{{OSFolder| id=28 | name=LocalApplicationData | osx1068=/Users/username/.local/share (inside unity) <br/>/Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share | win7=C:\Users\yourname\AppData\Local }}
 
{{OSFolder| id=32 | name=InternetCache | osx1068=/Users/yourname/Library/Caches | win7=C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files }}
 
{{OSFolder| id=32 | name=InternetCache | osx1068=/Users/yourname/Library/Caches | win7=C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files }}
 
{{OSFolder| id=33 | name=Cookies | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies }}
 
{{OSFolder| id=33 | name=Cookies | win7=C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies }}
Line 60: Line 67:
  
 
<br/>
 
<br/>
 +
 +
[[Category:KnowHow]]
 +
[[Category:C Sharp]]
 +
[[Category:Utility]]

Latest revision as of 11:16, 29 November 2013

Here is a list of the system paths you can retrieve using System.Environment.GetFolderPath.

For example:

System.Environment.GetFolderPath( System.Environment.SpecialFolder.ApplicationData )



Desktop (0)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Desktop
Windows7.gif Windows 7 C:\Users\yourname\Desktop

Programs (2)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

Personal (5)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname
Windows7.gif Windows 7 C:\Users\yourname\Documents

MyDocuments (5)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname
Windows7.gif Windows 7 C:\Users\yourname\Documents

Favorites (6)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Library/Favorites
Windows7.gif Windows 7 C:\Users\yourname\Favorites

Startup (7)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

Recent (8)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Recent

SendTo (9)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\SendTo

StartMenu (11)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Start Menu

MyMusic (13)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Music
Windows7.gif Windows 7 C:\Users\yourname\Music

DesktopDirectory (16)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Desktop
Windows7.gif Windows 7 C:\Users\yourname\Desktop

MyComputer (17)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 n/a

Templates (21)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Templates
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Templates

ApplicationData (26)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/.config
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming

LocalApplicationData (28)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/username/.local/share (inside unity)
/Applications/Unity/MonoDevelop.app/Contents/MacOS/../Frameworks/Mono.framework/Versions/Current/share
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local

InternetCache (32)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Library/Caches
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local\Microsoft\Windows\Temporary Internet Files

Cookies (33)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Roaming\Microsoft\Windows\Cookies

History (34)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Users\yourname\AppData\Local\Microsoft\Windows\History

CommonApplicationData (35)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /usr/share
Windows7.gif Windows 7 C:\ProgramData

System (37)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Windows\system32

ProgramFiles (38)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Applications
Windows7.gif Windows 7 C:\Program Files
or C:\Program Files (x86)

MyPictures (39)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) /Users/yourname/Pictures
Windows7.gif Windows 7 C:\Users\yourname\Pictures

CommonProgramFiles (43)
Apple.gif Mac OS X 10.6.8 (Snow Leopard) n/a
Windows7.gif Windows 7 C:\Program Files\Common Files
or C:\Program Files (x86)\Common Files

[edit] Code

[edit] Stand-alone

using System;
 
class Test
{
	static int Main(String[] argv)
	{
		var names = Enum.GetNames(typeof(Environment.SpecialFolder));
		var values = Enum.GetValues(typeof(Environment.SpecialFolder));
		for(int i = 0; i < names.Length; ++i)
			Console.WriteLine("{0} {1}: {2}", (int)values.GetValue(i), names[i], Environment.GetFolderPath((Environment.SpecialFolder)values.GetValue(i)));
 
		return 0;
	}
}


[edit] Inside Unity

var names = System.Enum.GetNames( typeof( System.Environment.SpecialFolder ) );
var values = System.Enum.GetValues( typeof( System.Environment.SpecialFolder ) );
for( int i = 0; i < names.Length; ++i )
    Debug.Log( (int)values.GetValue( i ) + " " + names[i] + ": " + System.Environment.GetFolderPath( (System.Environment.SpecialFolder)values.GetValue( i ) ) );


Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox