I am trying to open a file with read permissions
var namestart=fso.OpenTextFile("C:\\name.txt",1);
var name2=namestart.ReadAll();
namestart.Close();
But this file is not always filled with something, ReadAll gives an error when the file is empty because (of course) it cannot read what's in the file and returns an error. Is there any way I can catch this error?
var namestart=fso.OpenTextFile("C:\\naam.txt",1);
var name2="";
if(namestart.ReadAll() != ""){
name2=namestart.ReadAll();
}
namestart.Close();
That doesn't work either as ReadAll returns an error.