i try to read Text
file line by line:
static void Main(string[] args)
{
int counter = 0;
string line;
string links = @"D:\links.txt";
// Read the file and display it line by line.
System.IO.StreamReader file = new System.IO.StreamReader(links);
while ((line = file.ReadLine()) != null)
{
Console.WriteLine(line);
counter++;
}
file.Close();
// Suspend the screen.
Console.ReadLine();
}
And got an error:
An unhandled exception of type 'System.NotSupportedException' occurred in mscorlib.dll
Additional information: The given path's format is not supported.
I am working with Windows 10
Any suggestions what could cause this error ? (the file exist in this path)