A path does not necessarily point to a location on disk for example, a path might map to a location in memory or on a device. ' D:\Documents and Settings\cliffc\Local Settings\Temp\8\tmp3D.tmp is a file available for use.Ī path is a string that provides the location of a file or directory. ' D:\Documents and Settings\cliffc\Local Settings\Temp\8\ is the location for temporary files.
' The full path of temp is D:\Documents and Settings\cliffc\My Documents\Visual Studio 2005\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\temp. ' The string temp contains no root information. ' This code produces output similar to the following:
using namespace System Ĭonsole::WriteLine( ' is a file available for use.', Path.GetTempFileName()) The following example demonstrates some of the main members of the Path class.