-
Notifications
You must be signed in to change notification settings - Fork 270
Expand file tree
/
Copy pathPhotosFolder.cs
More file actions
39 lines (38 loc) · 1.24 KB
/
PhotosFolder.cs
File metadata and controls
39 lines (38 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace PhotoStoreDemo
{
public class PhotosFolder
{
public static string Current
{
get
{
string path = null;
if (ExecutionMode.IsRunningAsUwp())
{
path = ExecutionMode.GetSafeAppxLocalFolder();
}
if (path==null)
{
if(Directory.Exists(Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore"))
{
path = Path.Combine(Enviroment.GetFolderPath(Enviroment.SpecialFolders.LocalApplicationFolder), "PreviousPhotoStore");
}
path = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\PreviousPhotoStore"
var di = new DirectoryInfo(path);
if (!di.Exists)
{
di.Create();
}
}
return path;
}
}
}
}