Create a series of methods in a class to read and write text files, and in one of the methods I get an error:
public static void CreateAllText(string path, string contenidos, Encoding encoding)
{
if (!File.Exists(path))
{
using (StreamWriter sDocwriter = new StreamWriter(path, encoding, 1, false))
{
sDocwriter.Write(contenidos);
}
}
else
{
throw new ArgumentNullException("Error: Existe Archivo en la Ruta Especificada");
}
}
on the line:
using (StreamWriter sDocwriter = new StreamWriter ( path , encoding, 1, false))
Just in the path at design time is that the mentioned error comes out.