Ver Mensaje Individual
  #3 (permalink)  
Antiguo 15/10/2008, 05:47
subharb
 
Fecha de Ingreso: agosto-2008
Mensajes: 112
Antigüedad: 15 años, 9 meses
Puntos: 0
Respuesta: Descargar Contenido de mi Servidor

Muchas gracias, pero no logro que funcione nada!

Quiero hacer probar este código.
Código:
using System;
using System.IO;

class Test 
{
    public static void Main() 
    {
        // Specify the directories you want to manipulate.
        DirectoryInfo di = new DirectoryInfo(@"c:\MyDir");
        try 
        {
            // Determine whether the directory exists.
            if (di.Exists) 
            {
                // Indicate that the directory already exists.
                Console.WriteLine("That path exists already.");
                return;
            }

            // Try to create the directory.
            di.Create();
            Console.WriteLine("The directory was created successfully.");

            // Delete the directory.
            di.Delete();
            Console.WriteLine("The directory was deleted successfully.");

        } 
        catch (Exception e) 
        {
            Console.WriteLine("The process failed: {0}", e.ToString());
        } 
        finally {}
    }
}

En realidad lo quiero hacer es solo mostrar el contenido mi gran pregunta, es ¿Cómo hacer correr este código? podría ponerlo en un html entre etiquetas <script>? o solo puede ir en el archivo aspx.cs?