-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
44 lines (38 loc) · 1.29 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
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
namespace FogBugzImporter
{
class Program
{
static void Main(string[] args)
{
if (args.Length < 4)
{
Console.WriteLine("Usage: URL Username Password TicketsFile.\n");
Console.WriteLine("Example: http://localhost/fb/api.asp \"My Name\" \"Very Secret Password\" tickets.xls.\n");
return;
}
string url = args[0];
string name = args[1];
string password = args[2];
string ticketsFile = args[3];
if (!File.Exists(ticketsFile))
{
Console.WriteLine("Tickets file not found.\n");
return;
}
string sourceDir = Path.GetDirectoryName(ticketsFile);
string mediaDir = Path.Combine(sourceDir, "media");
if (!Directory.Exists(mediaDir))
{
Console.WriteLine("Directory with attachments data not found.\n");
return;
}
Importer importer = new Importer(url, name, password, ticketsFile, mediaDir);
importer.Connect();
importer.Import();
}
}
}