Prueba el mismo programa pero con C/C++ CLI o Visual C .net, lo mismo pero en .net y solo necesitas el .exe.
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúprivate void Form1_Load(object sender, EventArgs e)
{
Thread tr = new Thread(new ThreadStart(drawlines));
tr.Start();
}
public delegate void Function();
Point A = new Point(5, 5);
Point B = new Point(5, 5);
private void drawlines()
{
Thread.Sleep(1000);
drawMarco();
Thread.Sleep(25);
SetText("2", "PROJECTION:");
SetText("3", "IF INTRUDER ORGANISM REACHES");
SetText("4", "CIVILIZED AREAS . . .");
Thread.Sleep(100);
SetText("7", "ENTIRE WORLD POPULATION INFECTED");
SetText("8", "27,000 HOURS FROM FIRST CONTACT.");
Thread.Sleep(2000);
clrscr();
drawMarco();
SetText("1", "PROYECCIÓN:");
SetText("2", "SI ORGANISMO INTRUSO ALCANZA");
SetText("3", "ZONAS CIVILIZADAS . . . ");
Thread.Sleep(100);
SetText("7", "TODA LA POBLACIÓN MUNDIAL INFECTÓ");
SetText("8", "27,000 HORAS DESDE EL PRIMER");
SetText("9", "CONTACTO.");
Thread.Sleep(2000);
Application.Exit();
}
private void clrscr()
{
A = B;
Graphics ps = this.CreateGraphics();
ps.FillRectangle(new SolidBrush(Color.DarkBlue), 0,0, this.Width, this.Height);
foreach (Control control in Controls)
{
this.Invoke(new Function(delegate ()
{
control.Text = "";
}));
}
}
private void SetText(string name, string txt)
{
string nombre = $"label{name}";
foreach (char letra in txt)
{
this.Invoke(new Function(delegate ()
{
Controls[nombre].Text += letra;
}));
Console.Beep(600, 25);
Thread.Sleep(25);
}
}
private void drawMarco()
{
for (int i = 5; i < this.Width - 20; i++)
SetMarco(i, B.Y);
for (int i = 5; i < this.Height - 40; i++)
SetMarco(B.X, i);
for (int i = this.Width - 20; i > 5; i--)
SetMarco(i, B.Y);
for (int i = this.Height - 40; i > 5; i--)
SetMarco(B.X, i);
}
private void SetMarco(int x,int y)
{
this.Invoke(new Function(delegate ()
{
A = B;
B = new Point(x, y);
Graphics ps = this.CreateGraphics();
ps.DrawLine(new Pen(Color.Blue,3), A, B);
}));
Thread.Sleep(1);
}
using System;
using System.Windows.Forms;
namespace The_Thing_La_Cosa
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string texto = @"
PROJECTION:
IF INTRUDER ORGANISM REACHES
CIVILIZED AREAS . . .
ENTIRE WORLD POPULATION INFECTED
27,000 HOURS FROM FIRST CONTACT.
";
int contador = 0;
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text += texto[contador++];
if (contador >= texto.Length)
{
timer1.Enabled = false;
Console.Beep(600, 25); // Console.Beep(frecuencia, duracion);
}
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
}
using System;
using System.Threading;
namespace The_Thing_La_Cosa_Consola_01_cs
{
class Program
{
static void Main(string[] args)
{
Console.Title = "The Thing - La Cosa - C#";
Console.WindowWidth = 38; // X ancho.
Console.WindowHeight = 15; // Y altura.
int tiempo = 1;
// Cursor invisible.
Console.CursorVisible = false;
// Dibujar cuadro.
DrawMarco(1, 1, 35, 14);
// Escribir textos.
Console.SetCursorPosition(2, 4);
Escribir("PROJECTION: \n", 25);
Console.SetCursorPosition(2, 5);
Escribir("IF INTRUDER ORGANISM REACHES \n", 25);
Console.SetCursorPosition(2, 6);
Escribir("CIVILIZED AREAS . . . \n", 25);
Thread.Sleep(100);
Console.SetCursorPosition(2, 10);
Escribir("ENTIRE WORLD POPULATION INFECTED \n", 25);
Console.SetCursorPosition(2, 11);
Escribir("27,000 HOURS FROM FIRST CONTACT. \n", 25);
// En español.
Thread.Sleep(2000);
// Limpiar pantalla.
Console.Clear();
// Dibujar cuadro.
DrawMarco(1, 1, 35, 14);
// Escribir textos.
Console.SetCursorPosition(2, 3);
Escribir("PROYECCIÓN: \n", 25);
Console.SetCursorPosition(2, 4);
Escribir("SI ORGANISMO INTRUSO ALCANZA \n", 25);
Console.SetCursorPosition(2, 5);
Escribir("ZONAS CIVILIZADAS . . . \n", 25);
Thread.Sleep(100);
Console.SetCursorPosition(2, 9);
Escribir("TODA LA POBLACIÓN MUNDIAL INFECTÓ\n", 25);
Console.SetCursorPosition(2, 10);
Escribir("27,000 HORAS DESDE EL PRIMER\n", 25);
Console.SetCursorPosition(2, 11);
Escribir("CONTACTO. \n", 25);
Console.ReadKey();
}
public static void Escribir(string Cadena, int tiempo)
{
foreach (char letra in Cadena)
{
Console.Write(letra);
Thread.Sleep(tiempo);
}
}
private static void DrawMarco(int v1, int v2, int v3, int v4)
{
Console.ForegroundColor = ConsoleColor.Cyan; // Texto azul claro.
Console.BackgroundColor = ConsoleColor.DarkBlue; // Fondo azul oscuro.
Console.Clear(); // Para poner fondo azul oscuro en la pantalla completa.
Console.CursorVisible = false;
gotoXY(v1, v2, "┌");
for (int i = v1 + 1; i < v3; i++)
{
gotoXY(i, v2, "─");
}
gotoXY(v3, v2, "┐");
for (int i = v2 + 1; i < v4; i++)
{
gotoXY(v3, i, "│");
}
gotoXY(v3, v4, "┘");
for (int i = v3 - 1; i > v1; i--)
{
gotoXY(i, v4, "─");
}
gotoXY(v1, v4, "└");
for (int i = v4 - 1; i > v2; i--)
{
gotoXY(v1, i, "│");
}
//Console.CursorVisible = true;
}
private static void gotoXY(int v1, int v2, string cadena)
{
Console.SetCursorPosition(v1, v2);
Console.WriteLine(cadena);
Thread.Sleep(1);
}
}
}
Cita de: Eleкtro en 1 Marzo 2019, 11:29 AM
El que yo uso: https://www.screentogif.com/
FullProgreso = new string((char)177, Cantidad);
Console.Write(Encoding.ASCII.GetBytes((char)219));
using System;
using System.Threading;
namespace Barra_progreso_consola_03_cs
{
class Program
{
// Variable.
static double resultadoPorcentaje;
static void Main(string[] args)
{
Console.Title = "Simulador barra de progreso";
Console.WindowWidth = 60; // X ancho.
Console.WindowHeight = 10; // Y altura.
Console.CursorVisible = false;
// Variable.
int barra = 58;
int porcentaje = 0;
// Dibujamos la barra del portentaje.
Console.SetCursorPosition(0, 3);
Console.Write("0 % 50 % 100 %");
Console.SetCursorPosition(0, 4);
Console.Write("┌────────────────────────────┬───────────────────────────┐");
Console.SetCursorPosition(0, 5);
Console.Write("░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░"); // Ascii 176.
Console.SetCursorPosition(0, 5);
Console.ForegroundColor = ConsoleColor.Yellow;
for (int i = 0; i < barra; i++)
{
resultadoPorcentaje = (i + 1.0D) / (barra / 100.0);
Console.Write("█"); // Muestra ASCII 219 Dec y DB en Hex.
// Console.Write((char)219);
// Console.Write(Encoding.ASCII.GetBytes((char)219));
porcentaje++; // Incrementa valor.
PintarCargando(porcentaje);
Thread.Sleep(100); // 100 ms o 0.1 segundos.
}
// Pulse cualquier tecla para salir.
Console.ReadKey();
}
static void PintarCargando(int porcentaje)
{
Console.ForegroundColor = ConsoleColor.Gray;
Console.SetCursorPosition(0, 1);
Console.Write("Cargado: " + (resultadoPorcentaje).ToString("N0") + " %");// por dos para que simule el 100%
// Reestablecemos para que vuelva a pintar bajo la línea de carga.
Console.ForegroundColor = ConsoleColor.Yellow;
Console.SetCursorPosition(porcentaje, 5);
}
}
}
using System;
using System.Threading;
namespace Barra_progreso_consola_01_cs
{
class Program
{
static void Main(string[] args)
{
// Título de la ventana.
Console.Title = "Simulaor barra";
// Tamaño ventana consola.
Console.WindowWidth = 60; // X ancho.
Console.WindowHeight = 20; // Y altura.
// Cursor invisible.
Console.CursorVisible = false;
// Variables.
int barra = 58;
double porcentaje = 0;
Console.SetCursorPosition(17, 1);
Console.Write(" ");
Console.SetCursorPosition(17, 1);
Console.Write("");
// Dibujamos la barra del portentaje.
Console.SetCursorPosition(0, 3);
Console.Write("0 % 50 % 100 %");
Console.SetCursorPosition(0, 4);
Console.Write("┌────────────────────────────┬───────────────────────────┐");
//Console.SetCursorPosition(0, 5);
//Console.ForegroundColor = ConsoleColor.Yellow;
// Barra de progreso.
for (int i = 0; i <= barra; i++)
{
porcentaje = ((i + 1.0D) / (barra / 100.0));
Console.Write("█"); // Muestra ASCII 219 Dec y DB en Hex.
// Console.Write((char)219);
// Console.Write(Encoding.ASCII.GetBytes((char)219));
porcentaje++; // Incrementa valor.
printCargando(porcentaje);
Thread.Sleep(20); // 100 ms o 0.1 segundos.
}
Console.ReadKey();
}
static void printCargando(double porcentaje)
{
Console.ForegroundColor = ConsoleColor.Gray;
Console.SetCursorPosition(0, 1);
// Por dos para que simule el 100%.
Console.Write("Cargado: " + (porcentaje).ToString("N2") + " %");
//Console.Write("Cargado: {0} %", (porcentaje).ToString("N2"));
//Console.Write($"Cargado: { (porcentaje).ToString() } %");
// Reestablecemos para que vuelva a imprimir bajo la línea de carga.
Console.ForegroundColor = ConsoleColor.Yellow;
Console.SetCursorPosition(0, 5);
}
}
}
using System;
using System.Threading;
namespace Porcentaje_barra_consola_01_cs
{
class Program
{
public static int resultado = 0;
static void Main(string[] args)
{
// Título de la ventana.
Console.Title = "Simulaor barra";
// Tamaño ventana consola.
Console.WindowWidth = 60; // X ancho.
Console.WindowHeight = 20; // Y altura.
// Cursor invisible.
Console.CursorVisible = false;
// Variables.
int barra = 49;
int porcentaje = 0;
Console.SetCursorPosition(17, 1);
Console.Write(" ");
Console.SetCursorPosition(17, 1);
Console.Write("");
// Dibujamos la barra del portentaje.
Console.SetCursorPosition(0, 3);
Console.Write("0 % 50 % 100 %");
Console.SetCursorPosition(0, 4);
Console.Write("┌────────────────────────────┬───────────────────────────┐");
Console.SetCursorPosition(0, 5);
Console.ForegroundColor = ConsoleColor.Yellow;
// Barra de progreso.
for (int i = 0; i <= barra; i++)
{
Console.Write("█"); // Muestra ASCII 219 Dec y DB en Hex.
// Console.Write((char)219);
// Console.Write(Encoding.ASCII.GetBytes((char)219));
porcentaje++; // Incrementa valor.
printCargando(porcentaje);
Thread.Sleep(100); // 100 ms o 0.1 segundos.
}
Console.ReadKey();
}
static void printCargando(int porcentaje)
{
Console.ForegroundColor = ConsoleColor.Gray;
Console.SetCursorPosition(0, 1);
// Por dos para que simule el 100%.
Console.Write("Cargado: " + (porcentaje).ToString() + " %");
//Console.Write("Cargado: {0} %", (porcentaje * 2).ToString());
//Console.Write($"Cargado: { (porcentaje * 2).ToString() } %");
// Reestablecemos para que vuelva a imprimir bajo la línea de carga.
Console.ForegroundColor = ConsoleColor.Yellow;
Console.SetCursorPosition(porcentaje, 5);
}
}
}