-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
68 lines (61 loc) · 2.09 KB
/
Program.cs
File metadata and controls
68 lines (61 loc) · 2.09 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
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
using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace BusCE
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static int Main(string[] args)
{
int result = 0;
if (args.Length == 3)
{
Console.WriteLine("Ci sono {0} parametri", args.Length);
for (int i=0; i<args.Length; i++)
{
Console.WriteLine("parametro {0}: {1}", i, args[i]);
}
DeviceCE device = new DeviceCE();
// recupera i paramenti passati
foreach (string arg in args)
{
string par = arg.Split('=')[0];
string value = arg.Split('=')[1];
switch (par)
{
case "-lp":
device.localPath = value;
break;
case "-rp":
device.remotePath = value;
break;
case "-rf":
device.remoteFileSearch = value;
break;
default:
Console.WriteLine("Parametro {0} sconosciuto", arg);
result = -1;
break;
}
}
if ((device.localPath == null) && (device.remotePath == null) && (device.remoteFileSearch == null))
result = -1;
else
result = device.getFiles();
}
else
{
Console.WriteLine("Argomenti non sufficienti. Apro la GUI");
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
result = 0;
}
return result;
}
}
}