|
Este artículo proviene de un motor de traducción automática. Mueva el puntero sobre las frases del artículo para ver el texto original. Más información.
|
Traducción
Original
|
Path (Clase)
Espacio de nombres: System.IO
Ensamblado: mscorlib (en mscorlib.dll)
El tipo Path expone los siguientes miembros.
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() ![]() | ChangeExtension | |
![]() ![]() ![]() | Combine(String[]) | |
![]() ![]() ![]() | Combine(String, String) | |
![]() ![]() | Combine(String, String, String) | |
![]() ![]() | Combine(String, String, String, String) | |
![]() ![]() ![]() ![]() | GetDirectoryName | |
![]() ![]() ![]() ![]() | GetExtension | |
![]() ![]() ![]() ![]() | GetFileName | |
![]() ![]() ![]() ![]() | GetFileNameWithoutExtension | |
![]() ![]() ![]() | GetFullPath | |
![]() ![]() ![]() | GetInvalidFileNameChars | |
![]() ![]() ![]() ![]() | GetInvalidPathChars | |
![]() ![]() ![]() ![]() | GetPathRoot | |
![]() ![]() ![]() | GetRandomFileName | |
![]() ![]() | GetTempFileName | |
![]() ![]() | GetTempPath | |
![]() ![]() ![]() ![]() | HasExtension | |
![]() ![]() ![]() ![]() | IsPathRooted |
| Nombre | Descripción | |
|---|---|---|
![]() ![]() ![]() | AltDirectorySeparatorChar | |
![]() ![]() ![]() | DirectorySeparatorChar | |
![]() ![]() ![]() | InvalidPathChars | Obsoleto. |
![]() ![]() ![]() | PathSeparator | |
![]() ![]() ![]() | VolumeSeparatorChar |
Nota |
|---|
"c:\\MiDir\\MiArchivo.txt" en C# o "c:\MiDir\MiArchivo.txt" en Visual Basic. "c:\\MiDir" en C# o "c:\MiDir" en Visual Basic. "MiDir\\MiSubdir" en C# o "MiDir\MiSubDir" en Visual Basic. "\\\\MiServidor\\MiRecursoComp" en C# o "\\MiServidor\MiRecursoComp" en Visual Basic.
using System; using System.IO; class Test { public static void Main() { string path1 = @"c:\temp\MyTest.txt"; string path2 = @"c:\temp\MyTest"; string path3 = @"temp"; if (Path.HasExtension(path1)) { Console.WriteLine("{0} has an extension.", path1); } if (!Path.HasExtension(path2)) { Console.WriteLine("{0} has no extension.", path2); } if (!Path.IsPathRooted(path3)) { Console.WriteLine("The string {0} contains no root information.", path3); } Console.WriteLine("The full path of {0} is {1}.", path3, Path.GetFullPath(path3)); Console.WriteLine("{0} is the location for temporary files.", Path.GetTempPath()); Console.WriteLine("{0} is a file available for use.", Path.GetTempFileName()); /* This code produces output similar to the following: * c:\temp\MyTest.txt has an extension. * c:\temp\MyTest has no extension. * The string temp contains no root information. * The full path of temp is D:\Documents and Settings\cliffc\My Documents\Visual Studio 2005\Projects\ConsoleApplication2\ConsoleApplication2\bin\Debug\temp. * D:\Documents and Settings\cliffc\Local Settings\Temp\8\ is the location for temporary files. * D:\Documents and Settings\cliffc\Local Settings\Temp\8\tmp3D.tmp is a file available for use. */ } }
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (no se admite el rol Server Core), Windows Server 2008 R2 (se admite el rol Server Core con SP1 o versiones posteriores; no se admite Itanium)
.NET Framework no admite todas las versiones de todas las plataformas. Para obtener una lista de las versiones compatibles, vea Requisitos de sistema de .NET Framework.

