CSharpTest.Net
MaxPath Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.IO Namespace > FindFile Class : MaxPath Property

Glossary Item Box

Gets or sets the maximum number of allowed characters in a complete path, default = 4kb

Syntax

Visual Basic (Declaration) 
Public Property MaxPath As Integer
C# 
public int MaxPath {get; set;}

Example

Library/Library.Test/TestFindFile.cs

C#Copy Code
FindFile ff = new FindFile();
Assert.AreEqual("", ff.BaseDirectory);
Assert.AreEqual("*", ff.FilePattern);
Assert.AreEqual(true, ff.Recursive);
Assert.AreEqual(true, ff.IncludeFiles);
Assert.AreEqual(true, ff.IncludeFolders);
Assert.AreEqual(false, ff.RaiseOnAccessDenied);
Assert.AreEqual(4096, ff.MaxPath);

Assert.AreEqual(TestFolder, ff.BaseDirectory = TestFolder);
Assert.AreEqual("a.*", ff.FilePattern = "a.*");
Assert.AreEqual(false, ff.Recursive = false);
Assert.AreEqual(false, ff.IncludeFiles = false);
Assert.AreEqual(false, ff.IncludeFolders = false);
Assert.AreEqual(true, ff.RaiseOnAccessDenied = true);
Assert.AreEqual(1024, ff.MaxPath = 1024);

ff.FileFound += (o, e) => Assert.Fail("Should not find anything.");
ff.Find();
VB.NETCopy Code
Dim ff As New FindFile()
Assert.AreEqual("", ff.BaseDirectory)
Assert.AreEqual("*", ff.FilePattern)
Assert.AreEqual(True, ff.Recursive)
Assert.AreEqual(True, ff.IncludeFiles)
Assert.AreEqual(True, ff.IncludeFolders)
Assert.AreEqual(False, ff.RaiseOnAccessDenied)
Assert.AreEqual(4096, ff.MaxPath)

Assert.AreEqual(TestFolder, ff.BaseDirectory = TestFolder)
Assert.AreEqual("a.*", ff.FilePattern = "a.*")
Assert.AreEqual(False, ff.Recursive = False)
Assert.AreEqual(False, ff.IncludeFiles = False)
Assert.AreEqual(False, ff.IncludeFolders = False)
Assert.AreEqual(True, ff.RaiseOnAccessDenied = True)
Assert.AreEqual(1024, ff.MaxPath = 1024)

ff.FileFound += Function(o, e) Assert.Fail("Should not find anything.")
ff.Find()

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys