Skip to content

Editor de Textos: Unhandled exception. System.UnauthorizedAccessException: Access to the path is denied. #103

Discussion options

You must be logged in to vote

Desconsiderar resposta. Estava colocando o caminho errado :)
Tá tudo certinho!

`static void CreateFile()
{
Console.Clear();
Console.WriteLine("Escreva a vontade. Use 'Esc' para sair");
Console.WriteLine("=================");
var text = "";
do
{
text += Console.ReadLine();
text += Environment.NewLine;
} while (Console.ReadKey().Key != ConsoleKey.Escape);

Console.WriteLine("=================");
SaveFile(text);
}

static void SaveFile(string text)
{
Console.WriteLine("Você gostaria de salvar esse arquivo?");
Console.WriteLine("S - para Sim");
Console.WriteLine("N - para Não");
char option = char.Parse(Console.ReadLine().ToLower());

if (option == 'n')
{
Console.WriteLine("Fica pra próxima");
T…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by andrebaltieri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant