March 2004
Intermediate to advanced
560 pages
26h 47m
English
using System;
using System.IO;
namespace Samples
{
public class PathTooLongExceptionSample
{
public static void Main()
{
try
{
string p = @"This\Is\A\Very\Long\Path\" +
@"But\It\Is\Only\An\Example\";
string s = @"C:\" + p + p + p + p + p + p +
"filename.txt";
FileStream fs = File.Create(s);
}
catch(PathTooLongException e)
{
Console.WriteLine("Exception: {0}", e);
}
}
}
}
Exception: System.IO.PathTooLongException: The path is too long after being fully qualified. Make sure path is less than 260 characters. at System.IO.Path.nGetFullPathHelper(String path, Char[] invalidPathChars, Char[] whitespaceChars, Char directorySeparator, Char altDirectorySeparator, Boolean fullCheck, String& newPath) at System.IO.Path.GetFullPathInternal(String ...
Read now
Unlock full access