-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
88 lines (88 loc) · 3.35 KB
/
Program.cs
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
using System;
namespace Pixol
{
partial class Program
{
[STAThread]
static void Main(string[] args)
{
try
{
if (args.Length > 1)
{
if (args[0] == "-public")
{
if (args.Length > 2)
{
if (args[2] == "-likes")
{
if (args.Length > 3)
{
getPublicPhotos(args[1],Convert.ToInt32(args[3]));
}
else
{
Console.WriteLine("WARNING: Argument value was not specified default argument value was used.");
}
}
else
{
throw new System.InvalidOperationException("Error: Invalid arguments.");
}
}
else
{
getPublicPhotos(args[1]);
}
}
else if (args[0] == "-private")
{
if (args.Length > 2)
{
if (args.Length > 3)
{
if (args[3] == "-likes")
{
if (args.Length > 4)
{
getPrivatePhotos(args[1], args[2], Convert.ToInt32(args[4]));
}
else
{
Console.WriteLine("WARNING: Argument value was not specified default argument value was used.");
}
}
else
{
throw new System.InvalidOperationException("Error: Invalid arguments.");
}
}
else
{
getPrivatePhotos(args[1], args[2]);
}
}
else
{
throw new System.InvalidOperationException("Error: Invalid arguments.");
}
}
else
{
throw new System.InvalidOperationException("Error: Invalid arguments.");
}
}
else
{
throw new System.InvalidOperationException("Error: Invalid arguments.");
}
Console.WriteLine("Downloaded Successfully!");
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.Read();
}
}
}