-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
29 lines (26 loc) · 996 Bytes
/
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
using System.IO;
namespace Extensibility
{
/// <summary>
/// Como exemplo de extensibilidade, esse projeto demonstra uma classe AccessControl
/// que controla o acesso ao sistema.
///
/// Entre na classe AccessControl assim como nas classes que implementam a interface
/// ILogger para melhor entendimento.
/// </summary>
class Program
{
static void Main(string[] args)
{
var username = "alexandre";
var password = "Abc123!";
// Exemplo de logs usando console
var secondAccessExample = new AccessControl(new ConsoleLogger());
secondAccessExample.Login(username, password);
// Exemplo de gravação de logs em arquivo de texto
var logDirectory = $"{Directory.GetCurrentDirectory()}\\log.txt";
var firstAccessExample = new AccessControl(new FileLogger(logDirectory));
firstAccessExample.Login(username, password);
}
}
}