Skip to content

Commit 5c8e89f

Browse files
committed
Locations text file added with image locations found based on users stored in the file - first user is saved to as well
1 parent d21172c commit 5c8e89f

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
user
2+
others

GrabWindows10LockScreenPictures/GrabWindows10LockScreenPictures.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<None Remove="Data\lion.png" />
1414
<None Remove="Data\lionicon.ico" />
1515
<None Remove="Data\lion_icon.ico" />
16+
<None Remove="Data\locations.txt" />
1617
</ItemGroup>
1718

1819
<ItemGroup>
@@ -36,6 +37,9 @@
3637
<Resource Include="Data\lionicon.ico">
3738
<CopyToOutputDirectory>Never</CopyToOutputDirectory>
3839
</Resource>
40+
<Content Include="Data\locations.txt">
41+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
42+
</Content>
3943
</ItemGroup>
4044

4145
</Project>

GrabWindows10LockScreenPictures/Program.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
namespace GrabWindows10LockScreenPictures {
88
class Program {
99
static void Main(string[] args) {
10-
string assetsAryeh = @"C:\Users\user\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets";
11-
string assetsOthers = @"C:\Users\others\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets";
12-
string saved = @"C:\Users\user\Pictures\Spotlight Images";
10+
string[] users = File.ReadAllLines(Path.GetFullPath("Data/locations.txt"));
11+
string saved = @$"C:\Users\{users.FirstOrDefault()}\Pictures\Spotlight Images";
1312

1413
try {
15-
GetPics(assetsAryeh, saved);
16-
GetPics(assetsOthers, saved);
14+
foreach (string name in users) {
15+
GetPics(@$"C:\Users\{name}\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets", saved);
16+
}
1717

1818
PopTheToast.PopIt("All images were successfully saved.");
1919
} catch (Exception ex) {

0 commit comments

Comments
 (0)