Hi ,
Following is my code..Its showing the error "A new expression requires (), [], or {} after type"
Please help me
DirectoryInfo dirInfo = new DirectoryInfo(GetLogFilePath()); List<string> files = new List<string>(); foreach (FileInfo fInfo in dirInfo.GetFiles()) { files.Add(fInfo.Name); } List<LogFileModel> logfilemodel=new List<LogFileModel> if( files.Count>0) { foreach(string f1 in files) { LogFileModel log=new LogFileModel(); log.FileName=f1; logfilemodel.Add(log); } } else{ logfilemodel=null; } return View();
The error is showing in the line
if( files.Count>0)
How to check the count of the list of string
Thanks
Vidya
Vidya001
List<LogFileModel> logfilemodel=new List<LogFileModel>
That should be
List<LogFileModel> logfilemodel=new List<LogFileModel>();
Thanks a looot..its working