I have a charp file and have created in JetBrainsRider -> Console Project. In main method, there is code as below
static void Main(string[] args)
{
string FileNamePrefix = string.Empty;
string InfoFileName = string.Empty;
if (args.Count() > 0)
{
FileNamePrefix = args[0];
}
else
{
Console.Write("Enter File Name (no extension): ");
FileNamePrefix = Console.ReadLine();
}
InfoFileName = "InOut\\" + FileNamePrefix + "-INFO.TXT";
if (!File.Exists(InfoFileName))
{
Console.WriteLine("{0} does not exist. Run Terminated", InfoFileName);
return;
}
}
When I place a TestInput-INFO.TXT file in project folder and give name in readline input, it gives error:
Enter File Name (no extension): TestInput
InOut\TestInput-INFO.TXT does not exist. Run Terminated