Kbase P160534: How to get a folder path from System.Environment+SpecialFolder enum
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  22/02/2010 |
|
Status: Unverified
GOAL:
How to get a folder path from System.Environment+SpecialFolder enum
GOAL:
How to access the path to a special folder using the System.Environment+SpecialFolder enum .NET object
FACT(s) (Environment):
Windows
OpenEdge 10.2x
FIX:
The members of this enum are accessed like static properties of the System.Environment+SpecialFolder object. To save a folder as an object you'd define a variable of that type and simply assign it to a particular folder as follows:
DEFINE VARIABLE oFavorites AS System.Environment+SpecialFolder NO-UNDO.
oFavorites = System.Environment+SpecialFolder:Favorites.
To get the underlying value of the folder path you would need to use the GetFolderPath method under the static class System.Environment, as follows:
MESSAGE System.Environment:GetFolderPath(oFavorites) VIEW-AS ALERT-BOX.
or more directly...
MESSAGE System.Environment:GetFolderPath(System.Environment+SpecialFolder:Favorites) VIEW-AS ALERT-BOX.