Verificar se o arquivo existe ASP.NET C#

quarta-feira, 17 agosto 2011 11:52 por leolima77

Método para verificar se existe determinado arquivo

public bool _existeArquivo(string arquivo)
        {
            bool bRetorno = false;
            vars h = new vars();

            if (!String.IsNullOrEmpty(arquivo))
            {
                FileInfo a = new FileInfo(arquivo);

                if (a.Exists)
                {
                    bRetorno = true;
                }
            }

            return bRetorno;
        }
Tags:   , ,
Categorias:   Dicas
Ferramentas:   E-mail | del.icio.us | digg | rec6 | linkk | Permalink