This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
// Definindo as datas: | |
DateTime data1 = new DateTime(2024, 1, 1, 1, 1, 1); | |
DateTime data2 = DateTime.Now; | |
// Pegando o intervalo entre duas datas: | |
TimeSpan intervalo = data2 - data1; | |
Console.WriteLine("{0} - {1} = {2} dias", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
List<string> colors = new List<string>() | |
{ | |
"Azul", "Roxo", "Vermelho" | |
}; | |
foreach (var color in colors) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.IO; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
using (StreamReader reader = File.OpenText("conteudo.txt")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using FluentValidation; | |
using FluentValidation.Results; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var dataNascimento = DateOnly.Parse("04/15/1890"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var dataHoraAtual = DateTime.Now; | |
//Pegando data e hora atual a partir da classe DateTime: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var novaPessoa = new Pessoa(); | |
novaPessoa.Nome = "Yure"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
//Testando: | |
var dog = new Dog(); | |
dog.Start(); | |
dog.Stop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Projeto.Application.Utilities | |
{ | |
public static class ProtocolGenerator | |
{ | |
private static readonly Random RandomGenerator = new Random(); | |
public static string GenerateRandomProtocol(int length = 10) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Método de extensão para tradizir mensagens de erro do plugin jQuery Validation. | |
* Locale: PT_BR | |
*/ | |
jQuery.extend(jQuery.validator.messages, { | |
required: "Este campo é requerido.", | |
remote: "Por favor, corrija este campo.", | |
email: "Por favor, forneça um endereço eletrônico válido.", | |
url: "Por favor, forneça uma URL válida.", | |
date: "Por favor, forneça uma data válida.", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Security.Cryptography; | |
using System.Linq; | |
public class Program | |
{ | |
public static Protocolo protocolo { get; set; } | |
public static void Main() |
NewerOlder