![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
Archivos de broma con C#
Hola:
Me ha enviado un archivo en CMD de broma que me llena los PenDrive de 8 GB a tope. En mi caso le quiero devolver la jugada en plan broma y lo único que se me ocurre es esto. Tarda en escribirse, pero él lo hacía más rapido que mi método. ¿Alguien le sale mejor? Código:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO; // No olvidar desde aquí.
namespace CMD_Serie
{
class Program
{
private const string FILE_NAME = "Archivo.txt";
static void Main(string[] args)
{
if (File.Exists(FILE_NAME))
{
Console.WriteLine("{0} ya existe.", FILE_NAME);
Console.ReadKey();
return;
}
using (StreamWriter sw = File.CreateText(FILE_NAME))
{
for (long i = 1; i <= 999999999999999999; i++)
{
Console.WriteLine(i);
sw.WriteLine(i);
//sw.Close();
}
}
}
}
}
__________________
http://electronica-pic.blogspot.com....n-arduino.html Manuales de electrónica general, PIC y Arduino. |
|
#2
|
||||
|
||||
|
Realmente estas pensando enviar un virus con mensajes de error y con C#? Al menos no estás agregando soporte.
![]() Personalmente creo que usar un cmd se ve como mejor opción pero en tu código, yo simplemente reemplazaría el for por un bucle infinito + un try. Algunas ideas malévolas con cmd Código:
@echo off begin: rem cambia goatse por un sitio que aún exista start http://goatse.cx goto begin
__________________
self.free; |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Ya me cansé de Linux y sus mentiras (Ojo, se trata de una broma) | ixMike | La Taberna | 82 | 13-03-2008 02:36:04 |
| Broma con el escritorio de XP | marcoszorrilla | La Taberna | 3 | 14-02-2007 20:17:09 |
| Reflexiones en broma | jhonny | Humor | 0 | 15-11-2005 21:18:19 |
|