Created
July 18, 2015 12:49
-
-
Save Fhernd/eaa53385cda29e49a0a5 to your computer and use it in GitHub Desktop.
Uso de rutas relativas en C#.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OrtizOL - xCSw - http://ortizol.blogspot.com | |
using System; | |
using System.IO; | |
namespace Receta.CSharp.R0514 | |
{ | |
public class ManipulacionRutasRelativas | |
{ | |
public static void Main() | |
{ | |
Console.WriteLine(Environment.NewLine); | |
Console.WriteLine("Ruta actual: {0}", Directory.GetCurrentDirectory()); | |
Console.WriteLine("La ruta relativa del archivo `ArchivoTexto.txt` es {0}.", Path.GetFullPath("ArchivoTexto.txt")); | |
Console.WriteLine (); | |
Console.WriteLine("Cambio del directorio actual a C:\\etc"); | |
Directory.SetCurrentDirectory(@"C:\etc"); | |
Console.WriteLine("Ahora la ruta relativa del archivo `ArchivoTexto.txt` es {0}.", Path.GetFullPath("ArchivoTexto.txt")); | |
Console.WriteLine(Environment.NewLine); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment