Not Monitored
Tag not monitored by Microsoft.
35,529 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Estava tentando retornar dados de clientes de um arquivo txt estava tudo funcionando ai me vem esse erro
aqui o codigo fonte
public List<IPessoa> Ler()
{
var dados = new List<Base>();
if (File.Exists(DiretorioComArquivo()))
{
using (StreamReader arquivo = File.OpenText(DiretorioComArquivo()))
{
string? linha;
int i = 0;
while ((linha = arquivo.ReadLine()) != null)
{
i++;
if (i == 1) { continue; }
var BaseArquivo = linha.Split(';');
var b = (IPessoa)Activator.CreateInstance(this.GetType());
if (b != null)
{
b.SetNome(BaseArquivo[0]);
b.SetTelefone(BaseArquivo[1]);
b.SetCPF(BaseArquivo[2]);
dados.Add((Base)b);
}
}
}
return dados;
Q&A forums are currently English only. I'd try asking for help over here in dedicated forums.
https://social.msdn.microsoft.com/Forums/pt-br/home
https://social.technet.microsoft.com/Forums/pt-br/home
https://answers.microsoft.com/pt-br
--please don't forget to upvote
and Accept as answer
if the reply is helpful--