-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
48 lines (42 loc) · 2.05 KB
/
Copy pathProgram.cs
File metadata and controls
48 lines (42 loc) · 2.05 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
using System;
using FileIndexSystem.Models;
namespace FileIndexSystem
{
class Main_Code
{
static void Main(string[] arg)
{
Console.WriteLine("============Welcome to the Shrimpy Company File Index System============");
Console.Write("Please put in the submitter name: ");
string nameInput = Console.ReadLine() ?? string.Empty;
Console.Write("Please put in the filepath with the FILENAME. (ex: C:\\FOLDERNAME\\FILENAME.pdf): ");
string pathInput = Console.ReadLine() ?? string.Empty;
pathInput = pathInput.Replace("&", "").Replace("'", "").Replace("\"", "").Trim();
Console.Write("Please put in the Notes for this file if needed: ");
string noteInput = Console.ReadLine() ?? string.Empty;
try
{
var myFile = new ArchiveFile(
noteInput: noteInput,
submitterName: nameInput,
filePath: pathInput
);
Console.WriteLine("=======Archive Complete! The Following is the file info...=======");
Console.WriteLine($"Your Archive ID is: {myFile.Id}");
Console.WriteLine($"Your Archive Filename is: {myFile.FileName}");
Console.WriteLine($"Your Archive Created time is: {myFile.CreatedTime}");
Console.WriteLine($"Your Archive Submitter is: {myFile.Submitter}");
Console.WriteLine($"Your Archive Note is: {myFile.Note}");
Console.WriteLine("=================================================================");
var storage = new FileStorage();
storage.SaveToFile(myFile);
Console.WriteLine("=======File has successfully been saved to the local storage(log.txt)!=======");
}
catch(Exception ex)
{
Console.WriteLine($"[Debug]Your input filepath: {pathInput}");
Console.WriteLine($"Archive Faild, {ex.Message}");
}
}
}
}