Crear Carpetas

11/11/2005 - 17:32 por Matías | Informe spam
con ASP.NET usando C#, necesito guardar los archivos que genero en carpeta
con nombres específicos. Como puedo crear carpetas ???

Gracias de Antemano

Preguntas similare

Leer las respuestas

#1 Jhonny Vargas P. [MVP]
11/11/2005 - 18:31 | Informe spam
Hola Matías,

Con Directory (ejemplo sacado de la ayuda MSDN)

[C#]
using System;
using System.IO;

class Test
{
public static void Main()
{
// Specify the directory you want to manipulate.
string path = @"c:\MyDir";

try
{
// Determine whether the directory exists.
if (Directory.Exists(path))
{
Console.WriteLine("That path exists already.");
return;
}

// Try to create the directory.
DirectoryInfo di = Directory.CreateDirectory(path);
Console.WriteLine("The directory was created successfully at
{0}.", Directory.GetCreationTime(path));

// Delete the directory.
di.Delete();
Console.WriteLine("The directory was deleted successfully.");
}
catch (Exception e)
{
Console.WriteLine("The process failed: {0}", e.ToString());
}
finally {}
}
}


Saludos,
Jhonny Vargas P.
Santiago de Chile
http://msmvps.com/jvargas



"Matías" escribió en el mensaje
news:u$
con ASP.NET usando C#, necesito guardar los archivos que genero en carpeta
con nombres específicos. Como puedo crear carpetas ???

Gracias de Antemano



email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida