Gets the path to the directory.
Namespace:
ESRI.ArcGISExplorer.DataAssembly: ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)
Syntax
Field Value
The path to the directory.Examples
The code below illustrates how to create a DataDirectory object which is then used to open a number of data types. The Path property
is used to print out the file system path stored in the DataDirectory object.
CopyC#
//Create a DataDirectory object for the specified file path DataDirectory dir = new DataDirectory(@"C:\Data"); //Print the path to the data System.Diagnostics.Debug.Print(dir.Path); //Prints "C:\Data" //Example 1 - open the mountains shapefile then print the name and whether it can store vector data. Table mtnsTable = dir.OpenTable("mountains"); System.Diagnostics.Debug.Print(mtnsTable.Name); //Prints "mountains" System.Diagnostics.Debug.Print(mtnsTable.IsSpatial.ToString()); //Prints "True" //Example 2 - open the mtn_ratings dBase file then print out the name and whether it can store vector data. Table ratingsTable = dir.OpenTable("mtn_ratings"); System.Diagnostics.Debug.Print(ratingsTable.Name); //Prints "mtn_ratings" System.Diagnostics.Debug.Print(ratingsTable.IsSpatial.ToString()); //Prints "False" //Example 3 - open the southgorms.jpg raster file and print the name Raster gormsRaster = dir.OpenRaster("northgorms.jpg"); System.Diagnostics.Debug.Print(gormsRaster.Name); //Prints "northgorms.jpg""
CopyVB.NET
'Create a DataDirectory object for the specified file path Dim dir As DataDirectory = New DataDirectory("C:\Data") 'Print the path to the data System.Diagnostics.Debug.Print(dir.Path) 'Prints "C:\Data" 'Example 1 - open the mountains shapefile then print the name and whether it can store vector data. Dim mtnsTable As Table = dir.OpenTable("mountains") System.Diagnostics.Debug.Print(mtnsTable.Name) 'Prints "mountains" System.Diagnostics.Debug.Print(mtnsTable.IsSpatial.ToString()) 'Prints "True" 'Example 2 - open the mtn_ratings dBase file then print out the name and whether it can store vector data. Dim ratingsTable As Table = dir.OpenTable("mtn_ratings") System.Diagnostics.Debug.Print(ratingsTable.Name) 'Prints "mtn_ratings" System.Diagnostics.Debug.Print(ratingsTable.IsSpatial.ToString()) 'Prints "False" 'Example 3 - open the southgorms.jpg raster file and print the name Dim gormsRaster As Raster = dir.OpenRaster("northgorms.jpg") System.Diagnostics.Debug.Print(gormsRaster.Name) 'Prints "northgorms.jpg"