Colocar Entre el <HEAD> y </HEAD>
<SCRIPT LANGUAGE="JavaScript">
var arrRecords = new Array();
var arrCookie = new Array();
var recCount = 0;
var strRecord="";
expireDate = new Date;
expireDate.setDate(expireDate.getDate()+365);
function cookieVal(cookieName) {
thisCookie = document.cookie.split("; ")
for (i = 0; i < thisCookie.length; i++) {
if (cookieName == thisCookie[i].split("=")[0]) {
return thisCookie[i].split("=")[1];
}
}
return 0;
}
function loadCookie() {
if(document.cookie != "") {
if(cookieVal("Records") != ""){
arrRecords = cookieVal("Records").split(",");
}
currentRecord();
}
}
function setRec() {
strRecord = "";
for(i = 0; i < document.frm1.elements.length; i++) {
strRecord = strRecord + document.frm1.elements[i].value + ":";
}
arrRecords[recCount] = strRecord;
document.frm2.add.value = " NEW ";
document.cookie = "Records="+arrRecords+";expires=" + expireDate.toGMTString();
}
function newRec() {
switch (document.frm2.add.value) {
case " NEW " :
varTemp = recCount;
for(i = 0; i < document.frm1.elements.length; i++) {
document.frm1.elements[i].value = ""
}
recCount = arrRecords.length;
document.frm2.add.value = "CANCEL";
break;
case "CANCEL" :
recCount = varTemp;
document.frm2.add.value = " NEW ";
currentRecord();
break;
}
}
function countRecords() {
document.frm2.actual.value = "Record " + (recCount+1)+"; "+arrRecords.length+" saved records";
}
function delRec() {
arrRecords.splice(recCount,1);
navigate("previous");
setRec();
}
function currentRecord() {
if (arrRecords.length != "") {
strRecord = arrRecords[recCount];
currRecord = strRecord.split(":");
for(i = 0; i < document.frm1.elements.length; i++) {
document.frm1.elements[i].value = currRecord[i];
}
}
}
function navigate(control) {
switch (control) {
case "first" :
recCount = 0;
currentRecord();
document.frm2.add.value = " NEW ";
break;
case "last" :
recCount = arrRecords.length - 1;
currentRecord();
document.frm2.add.value = " NEW ";
break;
case "next" :
if (recCount < arrRecords.length - 1) {
recCount = recCount + 1;
currentRecord();
document.frm2.add.value = " NEW ";
}
break;
case "previous" :
if (recCount > 0) {
recCount = recCount - 1;
currentRecord();
}
document.frm2.add.value = " NEW ";
break;
default:
}
}
function pageLoad(){
if (!Array.prototype.splice) {
function array_splice(ind,cnt) {
if (arguments.length == 0) return ind;
if (typeof ind != "number") ind = 0;
if (ind < 0) ind = Math.max(0,this.length + ind);
if (ind > this.length) {
if (arguments.length > 2) ind = this.length;
else return [];
}
if (arguments.length < 2) cnt = this.length-ind;
cnt = (typeof cnt == "number") ? Math.max(0,cnt) : 0;
removeArray = this.slice(ind,ind+cnt);
endArray = this.slice(ind+cnt);
this.length = ind;
for (var i = 2; i < arguments.length; i++) {
this[this.length] = arguments[i];
}
for(var i = 0; i < endArray.length; i++) {
this[this.length] = endArray[i];
}
return removeArray;
}
Array.prototype.splice = array_splice;
}
recCount = 0;
loadCookie();
countRecords();
}
</script>
Colocar dentro del Tag <BODY> ejemplo <Body onLoad="pageLoad()">
Colocar entre el <BODY> y </BODY>
<center>
<form name="frm1">
<table align="center" resize="none" border="0">
<tr>
<td align="right">Name:</td>
<td colspan="5"><input type="box" name="name" size="49"></td>
</tr>
<tr>
<td align="right">Address:</td><td colspan="5"><input type="box" name="address" size="49"></td></tr>
<td align="right">Address 2:</td><td colspan="5" align="left"><input type="box" name="address2" size="49"></td>
</tr>
<tr>
<td align="right">City:</td>
<td><input type="box" name="city" size="15"></td>
<td>State:</td><td><input type="box" name="state" size="15"></td>
<td>Zip:</td><td><input type="box" size="6" name="zip"></td>
</tr>
<tr>
<td align="right">Phone:</td>
<td align="left"><input type="box" name="phone" size="15"></td>
<td align="right">Fax:</td><td align="left"><input type="box" name="fax" size="15"></td>
</tr>
<tr>
<td align="right">Web Page:<td colspan="5" align="left"><input type="box" name="address" size="49"></td>
</tr>
<tr>
<td align="right">E-Mail:<td colspan="5" align="left"><input type="box" name="email" size="49"></td>
</tr>
<tr>
<td align="right" valign="top">Comments:</td>
<td colspan="5" align="left"><input type="box" name="comment1" size="49"><br>
<input type="box" name="comment2" size="49"><br>
<input type="box" name="comment3" size="49"><br>
<input type="box" name="comment4" size="49"><br>
<input type="box" name="comment5" size="49">
</td>
</tr>
</table>
</form>
<form name="frm2">
<table align="center" border="1" resize="none">
<tr>
<td align="center">
<input type="button" name="first" value="|<< " onClick="navigate('first');countRecords()">
<input type="button" name="previous" value=" < " onClick="navigate('previous');countRecords()">
<input type="button" name="next" value=" > " onClick="navigate('next');countRecords()">
<input type="button" name="last" value=" >>|" onClick="navigate('last');countRecords()">
<input type="box" name="actual" size=30>
</td>
</tr>
<tr>
<td align="center">
<input type="button" name="add" value=" NEW " onClick="newRec();countRecords()">
<input type="button" name="set" value="SAVE RECORD" onClick="setRec();countRecords()">
<input type="button" name="del" value="Delete" onClick="delRec();countRecords()">
</td>
</tr>
</table>
</form>
</center>
Mostrando entradas con la etiqueta C sharp. Mostrar todas las entradas
Mostrando entradas con la etiqueta C sharp. Mostrar todas las entradas
martes, 14 de julio de 2015
JAVASCRIPT: Mostrar la Última Visita de una Persona en tu Web
En el <HEAD> Y </HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
var VisitorName = GetCookie('VisitorName')
if (VisitorName == null) {
VisitorName = prompt("Quién eres tú ?");
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}
function When(info){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat.substring(0,3)
var dateMonth = lastHereInDateFormat.substring(4,11)
var timeOfDay = lastHereInDateFormat.substring(11,16)
var year = lastHereInDateFormat.substring(23,25)
var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay
SetCookie ("WWhenH", rightNow.getTime(), exp)
return WWHText
}
function Count(info){
var WWHCount = GetCookie('WWHCount')
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount', WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("Quién eres tú ?");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
// End -->
</SCRIPT>
ENTRE EL <BODY> Y </BODY>
<SCRIPT LANGUAGE="JavaScript">
document.write("Hola " + Who() + ". Tú estuviste aquí " + Count() + " veces. La última vez fué: " + When() +".");
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
var expDays = 30;
var exp = new Date();
exp.setTime(exp.getTime() + (expDays*24*60*60*1000));
function Who(info){
var VisitorName = GetCookie('VisitorName')
if (VisitorName == null) {
VisitorName = prompt("Quién eres tú ?");
SetCookie ('VisitorName', VisitorName, exp);
}
return VisitorName;
}
function When(info){
var rightNow = new Date()
var WWHTime = 0;
WWHTime = GetCookie('WWhenH')
WWHTime = WWHTime * 1
var lastHereFormatting = new Date(WWHTime);
var intLastVisit = (lastHereFormatting.getYear() * 10000)+(lastHereFormatting.getMonth() * 100) + lastHereFormatting.getDate()
var lastHereInDateFormat = "" + lastHereFormatting;
var dayOfWeek = lastHereInDateFormat.substring(0,3)
var dateMonth = lastHereInDateFormat.substring(4,11)
var timeOfDay = lastHereInDateFormat.substring(11,16)
var year = lastHereInDateFormat.substring(23,25)
var WWHText = dayOfWeek + ", " + dateMonth + " at " + timeOfDay
SetCookie ("WWhenH", rightNow.getTime(), exp)
return WWHText
}
function Count(info){
var WWHCount = GetCookie('WWHCount')
if (WWHCount == null) {
WWHCount = 0;
}
else{
WWHCount++;
}
SetCookie ('WWHCount', WWHCount, exp);
return WWHCount;
}
function set(){
VisitorName = prompt("Quién eres tú ?");
SetCookie ('VisitorName', VisitorName, exp);
SetCookie ('WWHCount', 0, exp);
SetCookie ('WWhenH', 0, exp);
}
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function SetCookie (name, value) {
var argv = SetCookie.arguments;
var argc = SetCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
((path == null) ? "" : ("; path=" + path)) +
((domain == null) ? "" : ("; domain=" + domain)) +
((secure == true) ? "; secure" : "");
}
function DeleteCookie (name) {
var exp = new Date();
exp.setTime (exp.getTime() - 1);
var cval = GetCookie (name);
document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString();
}
// End -->
</SCRIPT>
ENTRE EL <BODY> Y </BODY>
<SCRIPT LANGUAGE="JavaScript">
document.write("Hola " + Who() + ". Tú estuviste aquí " + Count() + " veces. La última vez fué: " + When() +".");
</SCRIPT>
HTML: Buen Script si quieres poner un Color de Fondo Degradado a tu Página
Colocar dentro del <BODY >
Código:
style="filter:progid:DXImageTransform.Microsoft.Gradient( endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"
Ejemplo:
<body style="filter:progid:DXImageTransform.Microsoft.Gradient( endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');" >
Código:
style="filter:progid:DXImageTransform.Microsoft.Gradient( endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');"
Ejemplo:
<body style="filter:progid:DXImageTransform.Microsoft.Gradient( endColorstr='#C0CFE2', startColorstr='#FFFFFF', gradientType='0');" >
Calculadora en Consola C# (C Sharp)
namespace parcial
{
class examen
{
static void Main(string[] args)
{
Console.Title = "Calculadora";
Console.SetCursorPosition(55, 5);
Console.Write(" : Negro");
Console.SetCursorPosition(55, 6);
Console.Write(" : Blanco");
Console.SetCursorPosition(55, 7);
Console.Write(" : Amarillo");
Console.SetCursorPosition(55, 8);
Console.Write(" : Rojo");
Console.SetCursorPosition(55, 9);
Console.Write(" : Verde");
fondo();
Console.SetCursorPosition(55, 20);
Console.Write("/1/ : Muy pequeño");
Console.SetCursorPosition(55, 21);
Console.Write("/2/ : Pequeño");
Console.SetCursorPosition(55, 22);
Console.Write("/3/ : Normal");
Console.SetCursorPosition(55, 23);
Console.Write("/4/ : Mediano");
Console.SetCursorPosition(55, 24);
Console.Write("/5/ : Grande");
tamaño();
Console.SetCursorPosition(3, 2);
int a = ingreso();
Console.SetCursorPosition(3, 3);
int b = ingreso();
Console.SetCursorPosition(55, 2);
Console.Write("(+) : suma");
Console.SetCursorPosition(55, 4);
Console.Write("(-) : resta");
Console.SetCursorPosition(55, 6);
Console.Write("(*) : multiplicacion");
Console.SetCursorPosition(55, 8);
Console.Write("(/) : division");
Console.SetCursorPosition(3, 5);
Console.Write("===========================");
Console.SetCursorPosition(3, 11);
Console.Write("===========================");
Console.SetCursorPosition(3,6);
Console.Write("operacion");
operaciones(a, b);
Console.ReadKey();
}
static int ingreso()
{
Console.Write("Ingrese el numero--> ");
int n = Int16.Parse(Console.ReadLine());
return n;
}
static void operaciones(int x, int y)
{
Console.SetCursorPosition(25, 6);
string z = Console.ReadLine();
switch (z)
{
case "+":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x + y);
resultado();
break;
case "-":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x - y);
resultado();
break;
case "*":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x * y);
resultado();
break;
case "/":
Console.SetCursorPosition(25, 9);
Console.Write("{0:0.00}", x / y);
resultado();
break;
default:
Console.Write("Error");
break;
}
}
static void fondo()
{
Console.SetCursorPosition(3, 5);
Console.Write("¡CAMBIA EL COLOR DE FONDO!^^----> ");
char f = char.Parse(Console.ReadLine());
switch (f)
{
case 'N':
Console.BackgroundColor = ConsoleColor.Black;
Console.Clear();
break;
case 'B':
Console.BackgroundColor = ConsoleColor.White;
Console.Clear();
break;
case 'A':
Console.BackgroundColor = ConsoleColor.Yellow;
Console.Clear();
break;
case 'R':
Console.BackgroundColor = ConsoleColor.Red;
Console.Clear();
break;
case 'V':
Console.BackgroundColor = ConsoleColor.DarkGreen;
Console.Clear();
break;
default:
Console.Write("Error");
break;
}
}
static void tamaño()
{
Console.SetCursorPosition(3, 18);
Console.Write("¡VAMOS..AGRANDA O ACHICA!^^----> ");
string t = Console.ReadLine();
switch (t)
{
case "1":
Console.SetWindowSize(5,10);
Console.Clear();
break;
case "2":
Console.SetWindowSize(10,20);
Console.Clear();
break;
case "3":
Console.SetWindowSize(15,25);
Console.Clear();
break;
case "4":
Console.SetWindowSize(25,35);
Console.Clear();
break;
case "5":
Console.SetWindowSize(50,59);
Console.Clear();
break;
default:
Console.Write("Error");
break;
}
}
static void resultado()
{
Console.SetCursorPosition(3, 9);
Console.Write("RESULTADO");
int res = Int16.Parse(Console.ReadLine());
}
}
}
{
class examen
{
static void Main(string[] args)
{
Console.Title = "Calculadora";
Console.SetCursorPosition(55, 5);
Console.Write(" : Negro");
Console.SetCursorPosition(55, 6);
Console.Write(" : Blanco");
Console.SetCursorPosition(55, 7);
Console.Write(" : Amarillo");
Console.SetCursorPosition(55, 8);
Console.Write(" : Rojo");
Console.SetCursorPosition(55, 9);
Console.Write(" : Verde");
fondo();
Console.SetCursorPosition(55, 20);
Console.Write("/1/ : Muy pequeño");
Console.SetCursorPosition(55, 21);
Console.Write("/2/ : Pequeño");
Console.SetCursorPosition(55, 22);
Console.Write("/3/ : Normal");
Console.SetCursorPosition(55, 23);
Console.Write("/4/ : Mediano");
Console.SetCursorPosition(55, 24);
Console.Write("/5/ : Grande");
tamaño();
Console.SetCursorPosition(3, 2);
int a = ingreso();
Console.SetCursorPosition(3, 3);
int b = ingreso();
Console.SetCursorPosition(55, 2);
Console.Write("(+) : suma");
Console.SetCursorPosition(55, 4);
Console.Write("(-) : resta");
Console.SetCursorPosition(55, 6);
Console.Write("(*) : multiplicacion");
Console.SetCursorPosition(55, 8);
Console.Write("(/) : division");
Console.SetCursorPosition(3, 5);
Console.Write("===========================");
Console.SetCursorPosition(3, 11);
Console.Write("===========================");
Console.SetCursorPosition(3,6);
Console.Write("operacion");
operaciones(a, b);
Console.ReadKey();
}
static int ingreso()
{
Console.Write("Ingrese el numero--> ");
int n = Int16.Parse(Console.ReadLine());
return n;
}
static void operaciones(int x, int y)
{
Console.SetCursorPosition(25, 6);
string z = Console.ReadLine();
switch (z)
{
case "+":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x + y);
resultado();
break;
case "-":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x - y);
resultado();
break;
case "*":
Console.SetCursorPosition(25, 9);
Console.Write("{0}", x * y);
resultado();
break;
case "/":
Console.SetCursorPosition(25, 9);
Console.Write("{0:0.00}", x / y);
resultado();
break;
default:
Console.Write("Error");
break;
}
}
static void fondo()
{
Console.SetCursorPosition(3, 5);
Console.Write("¡CAMBIA EL COLOR DE FONDO!^^----> ");
char f = char.Parse(Console.ReadLine());
switch (f)
{
case 'N':
Console.BackgroundColor = ConsoleColor.Black;
Console.Clear();
break;
case 'B':
Console.BackgroundColor = ConsoleColor.White;
Console.Clear();
break;
case 'A':
Console.BackgroundColor = ConsoleColor.Yellow;
Console.Clear();
break;
case 'R':
Console.BackgroundColor = ConsoleColor.Red;
Console.Clear();
break;
case 'V':
Console.BackgroundColor = ConsoleColor.DarkGreen;
Console.Clear();
break;
default:
Console.Write("Error");
break;
}
}
static void tamaño()
{
Console.SetCursorPosition(3, 18);
Console.Write("¡VAMOS..AGRANDA O ACHICA!^^----> ");
string t = Console.ReadLine();
switch (t)
{
case "1":
Console.SetWindowSize(5,10);
Console.Clear();
break;
case "2":
Console.SetWindowSize(10,20);
Console.Clear();
break;
case "3":
Console.SetWindowSize(15,25);
Console.Clear();
break;
case "4":
Console.SetWindowSize(25,35);
Console.Clear();
break;
case "5":
Console.SetWindowSize(50,59);
Console.Clear();
break;
default:
Console.Write("Error");
break;
}
}
static void resultado()
{
Console.SetCursorPosition(3, 9);
Console.Write("RESULTADO");
int res = Int16.Parse(Console.ReadLine());
}
}
}
lunes, 13 de julio de 2015
C# - Calculadora sencilla usando Metodos
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using c = System.Console;
/* Para más códigos visita www.zvipuapica.blogspot.com , KEHACKSOFT */
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
c.Title="Calculadora Sencilla Usando Metodos";
string s=signo();
int n1=ingreso();/*Igualamos el valor que toma
el método Ingreso() y lo asignamos a Una variable n1*/
int n2 = ingreso();/*Igualamos el valor que toma
el método Ingreso() y lo asignamos a Una variable n2*/
operacion(n1,n2,s);
denuevo();
c.ReadKey();
}
static int ingreso()
{
c.WriteLine("Ingresa un Numero");
int num = int.Parse(c.ReadLine());
return num;/*devolvemos el valor leido desde consola al metodo.
*/
}
static string signo()
{
c.WriteLine("Ingresa Una Operacion: + - * /");
string d=c.ReadLine();
return d;
}
static void operacion(int a, int b, string t)
{
switch (t)
{
case "+":
c.WriteLine("El resultado es: {0}", a + b);
break;
case "-":
c.WriteLine("El resultado es: {0}", a - b);
break;
case "*":
c.WriteLine("El resultado es: {0}", a * b);
break;
case "/":
c.WriteLine("El resultado es: {0}", a / b);
break;
default:
c.WriteLine(" ");
c.WriteLine(" ");
c.Write("¡¡¡Error!!!");
c.WriteLine(" ");
c.WriteLine(" ");
break;
}
}
static void denuevo()
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("Desea Hacer Otra Operacion: 1=Si 2=No");
string rsp=c.ReadLine();
if (rsp == "1")
{
Main();
}
else if (rsp != "1" && rsp != "2")
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("¡¡Error Introdusca Una opcion valida..!!");
denuevo();
}
else
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("Gracias por Usar esta calculadora");
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
using c = System.Console;
/* Para más códigos visita www.zvipuapica.blogspot.com , KEHACKSOFT */
namespace ConsoleApplication1
{
class Program
{
static void Main()
{
c.Title="Calculadora Sencilla Usando Metodos";
string s=signo();
int n1=ingreso();/*Igualamos el valor que toma
el método Ingreso() y lo asignamos a Una variable n1*/
int n2 = ingreso();/*Igualamos el valor que toma
el método Ingreso() y lo asignamos a Una variable n2*/
operacion(n1,n2,s);
denuevo();
c.ReadKey();
}
static int ingreso()
{
c.WriteLine("Ingresa un Numero");
int num = int.Parse(c.ReadLine());
return num;/*devolvemos el valor leido desde consola al metodo.
*/
}
static string signo()
{
c.WriteLine("Ingresa Una Operacion: + - * /");
string d=c.ReadLine();
return d;
}
static void operacion(int a, int b, string t)
{
switch (t)
{
case "+":
c.WriteLine("El resultado es: {0}", a + b);
break;
case "-":
c.WriteLine("El resultado es: {0}", a - b);
break;
case "*":
c.WriteLine("El resultado es: {0}", a * b);
break;
case "/":
c.WriteLine("El resultado es: {0}", a / b);
break;
default:
c.WriteLine(" ");
c.WriteLine(" ");
c.Write("¡¡¡Error!!!");
c.WriteLine(" ");
c.WriteLine(" ");
break;
}
}
static void denuevo()
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("Desea Hacer Otra Operacion: 1=Si 2=No");
string rsp=c.ReadLine();
if (rsp == "1")
{
Main();
}
else if (rsp != "1" && rsp != "2")
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("¡¡Error Introdusca Una opcion valida..!!");
denuevo();
}
else
{
c.WriteLine(" ");
c.WriteLine(" ");
c.WriteLine("Gracias por Usar esta calculadora");
}
}
}
}
C# - Registro de Notas Usando Arrays
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*Para más códigos visita www.zvipuapica.blogspot.com, KEHACKSOFT */
/*using c = System.Console;*/
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Title="Registrando Notas…!";
Console.BackgroundColor=ConsoleColor.Red;
Console.ForegroundColor=ConsoleColor.Yellow;
Console.Clear();
int cont=0; string s=" "; string p=" ";
inicio(ref p, ref s, ref cont);
int[] num=new int[cont];
string[] alumnos=new string[cont];
float[]parcial=new float[cont];
float[]pfinal=new float[cont];
float[]promedio=new float[cont];
string[] estado=new string[cont];
ingreso(ref alumnos, ref parcial, ref pfinal);
promov(ref promedio, ref estado, ref parcial, ref pfinal, ref num);
Console.Clear();
salida(p,s,num,alumnos,parcial,pfinal,promedio,estado);
Console.ReadKey();
}
static void inicio(ref string nd, ref string nc, ref int na)
{
Console.WriteLine("Nombre del Docente");
nd=Console.ReadLine();
Console.WriteLine("Nombre de la Asignatura");
nc=Console.ReadLine();
Console.WriteLine("Número de Alumnos");
na=Int16.Parse(Console.ReadLine());
Console.Clear();
}
static void ingreso(ref string[] h, ref float[]a, ref float[]r)
{
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine("Nombre del Alumno");
h[i] =Console.ReadLine();
Console.WriteLine("Nota del Parcial");
a[i] =float.Parse(Console.ReadLine());
Console.WriteLine("Nota del Parcial Final");
r[i] =float.Parse(Console.ReadLine());
Console.Clear();
}
}
static void promov(ref float[] z, ref string[] x, ref float[] c, ref float[]v, ref int[]b)
{
for (int i=0; i {
b[i]=i+1;
}
for(int i=0; i {
z[i]=(c[i]+v[i])/2;
for (int k=0; k {
if (z[k]<10 .5="" br=""> x[k]="Desaprobado";
else
x[k]="Aprobado";
}
}
}
static void salida(string a, string s, int[] d, string[] f, float[] g, float[] h, float[] j, string[] k)
{
Console.WriteLine("Nombre del Docente: {0}", a);
Console.WriteLine("Nombre del curso: {0}", s);
Console.SetCursorPosition(0,3);
Console.Write("Numero");
Console.SetCursorPosition(7,3);
Console.Write("Alumno");
Console.SetCursorPosition(32,3);
Console.Write("Parcial");
Console.SetCursorPosition(40,3);
Console.Write("Parcial-Final");
Console.SetCursorPosition(54,3);
Console.Write("Promedio");
Console.SetCursorPosition(65,3);
Console.Write("Estado");
for (int i=0; i {
Console.SetCursorPosition(1, i+5);
Console.WriteLine(d[i]);
Console.SetCursorPosition(12, i + 5);
Console.WriteLine(f[i]);
Console.SetCursorPosition(35, i + 5);
Console.WriteLine(g[i]);
Console.SetCursorPosition(46, i + 5);
Console.WriteLine(h[i]);
Console.SetCursorPosition(56, i + 5);
Console.WriteLine(j[i]);
Console.SetCursorPosition(65, i + 5);
Console.WriteLine(k[i]);
}
}
}
} 10>
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*Para más códigos visita www.zvipuapica.blogspot.com, KEHACKSOFT */
/*using c = System.Console;*/
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Console.Title="Registrando Notas…!";
Console.BackgroundColor=ConsoleColor.Red;
Console.ForegroundColor=ConsoleColor.Yellow;
Console.Clear();
int cont=0; string s=" "; string p=" ";
inicio(ref p, ref s, ref cont);
int[] num=new int[cont];
string[] alumnos=new string[cont];
float[]parcial=new float[cont];
float[]pfinal=new float[cont];
float[]promedio=new float[cont];
string[] estado=new string[cont];
ingreso(ref alumnos, ref parcial, ref pfinal);
promov(ref promedio, ref estado, ref parcial, ref pfinal, ref num);
Console.Clear();
salida(p,s,num,alumnos,parcial,pfinal,promedio,estado);
Console.ReadKey();
}
static void inicio(ref string nd, ref string nc, ref int na)
{
Console.WriteLine("Nombre del Docente");
nd=Console.ReadLine();
Console.WriteLine("Nombre de la Asignatura");
nc=Console.ReadLine();
Console.WriteLine("Número de Alumnos");
na=Int16.Parse(Console.ReadLine());
Console.Clear();
}
static void ingreso(ref string[] h, ref float[]a, ref float[]r)
{
for (int i = 0; i < a.Length; i++)
{
Console.WriteLine("Nombre del Alumno");
h[i] =Console.ReadLine();
Console.WriteLine("Nota del Parcial");
a[i] =float.Parse(Console.ReadLine());
Console.WriteLine("Nota del Parcial Final");
r[i] =float.Parse(Console.ReadLine());
Console.Clear();
}
}
static void promov(ref float[] z, ref string[] x, ref float[] c, ref float[]v, ref int[]b)
{
for (int i=0; i {
b[i]=i+1;
}
for(int i=0; i
z[i]=(c[i]+v[i])/2;
for (int k=0; k
if (z[k]<10 .5="" br=""> x[k]="Desaprobado";
else
x[k]="Aprobado";
}
}
}
static void salida(string a, string s, int[] d, string[] f, float[] g, float[] h, float[] j, string[] k)
{
Console.WriteLine("Nombre del Docente: {0}", a);
Console.WriteLine("Nombre del curso: {0}", s);
Console.SetCursorPosition(0,3);
Console.Write("Numero");
Console.SetCursorPosition(7,3);
Console.Write("Alumno");
Console.SetCursorPosition(32,3);
Console.Write("Parcial");
Console.SetCursorPosition(40,3);
Console.Write("Parcial-Final");
Console.SetCursorPosition(54,3);
Console.Write("Promedio");
Console.SetCursorPosition(65,3);
Console.Write("Estado");
for (int i=0; i
Console.SetCursorPosition(1, i+5);
Console.WriteLine(d[i]);
Console.SetCursorPosition(12, i + 5);
Console.WriteLine(f[i]);
Console.SetCursorPosition(35, i + 5);
Console.WriteLine(g[i]);
Console.SetCursorPosition(46, i + 5);
Console.WriteLine(h[i]);
Console.SetCursorPosition(56, i + 5);
Console.WriteLine(j[i]);
Console.SetCursorPosition(65, i + 5);
Console.WriteLine(k[i]);
}
}
}
}
domingo, 12 de julio de 2015
Estamos de Vuelta!
Aviso Importante: Este Blog es un Proyecto Beneficioso para Jóvenes, Técnicos e Ingenieros .
Mediante nuestros aportes hemos podido observar una evolución referente al interés de incorporarse más usuarios en el mundo de la Programación Digital.
Por tanto hemos decidido retomar las innovaciones que habrían sido descontinuadas.
Desde luego, podrás comentarnos tus dudas o aportes.
Todos los códigos son de nuestra propiedad intelectual. No pirateamos.
Aquí encontraras la forma de iniciarte en el mundo de la programación digital, un mundo fascinante y extraordinario.
Proyectos Universitarios de Programación Digital.
Los códigos son totalmente Gratis.
Apoyanos, haz una pequeña donación Voluntaria (PayPal) para mantenernos vigentes.
Somos Estudiantes de Ingeniería de Sistemas e Informática y necesitamos tu apoyo.
Gracias.
miércoles, 15 de septiembre de 2010
JAVA Netbeans: Area y Perimetro de un Triangulo Isoseles
Aporte de : Isamar
-->
-->
package triangulo_isoceles;
import java.util.Scanner;
/**
*
* @author Isamar
*/
class Triangulo_isoceles {
double LadoMayor;//base
double Lado1;//lado igual 1
double Lado2;//lado igual 2
Triangulo_isoceles(double LM, double Lm)
{
LadoMayor = LM;
Lado1= Lm;
Lado2= Lm;
}
public double Calcula_Perimetro()
{
double perimetro;
perimetro = LadoMayor + (2*Lado1);//perimetro
return perimetro;
}
public double Calcula_Area()
{
double Area;
double Altura;
Altura=Math.sqrt(Math.pow(Lado1, 2)-Math.pow((LadoMayor/2),2));
Area=(LadoMayor*Altura)/2;
return Area;
}
}
public class Aplicacion {
public static void main(String[] args) {
double LMayor;
double Lmenor;
int opc;
Scanner leer=new Scanner(System.in);
do{
System.out.println("Atencion: Los lados equilateros sumados deben ser mayor que la base");
System.out.println("Ingrese la longitud del lado mayor del triangulo: ");
LMayor= leer.nextDouble();
System.out.println("Ingrese la longitud de los lados equilateros:");
Lmenor=leer.nextDouble();
}
while(LMayor> Lmenor+Lmenor || Lmenor + LMayor
Triangulo_isoceles T= new Triangulo_isoceles(LMayor,Lmenor);
do{
System.out.println("---------MENU--------");
System.out.println("[1] Modificar la longitud de los lados.");
System.out.println("[2] Mostrar el perimetro del triangulo.");
System.out.println("[3] Mostrar el area del triangulo");
System.out.println("[4] Salir");
opc=leer.nextInt();
switch(opc)
{
case 1:
{
do{
System.out.println("Atencion: Los lados equilateros sumados deben ser mayor que la base");
System.out.println("Ingrese la longitud del lado mayor del triangulo: ");
T.LadoMayor= leer.nextDouble();
System.out.println("Ingrese la longitud de los lados equilateros:");
T.Lado1=leer.nextDouble();
T.Lado2=T.Lado1;
}while(T.LadoMayor>T.Lado1+T.Lado2 || T.LadoMayor + T.Lado1
break;
}
case 2:
{
System.out.println("El perimetro del triangulo es: "+T.Calcula_Perimetro());
break;
}
case 3:
{
System.out.println("El area del triangulo es: "+ T.Calcula_Area());
break;
}
case 4:
{
break;
}
default:
{
System.out.println("Error, opcion incorrecta");
break;
}
}
}while (opc != 4);
}
}
martes, 14 de septiembre de 2010
JAVA Netbeans: Que tipo de triangulo es solo x sus Lados? y calcular area y perimetro del triangulo Isoseles
Aqui les dejo mi Codigo Fuente:::
He creado 5 clases están enumeradas...!
1.- Work (Main)
package trabajo;
/**
*
* @author KEHACKSOFT
*/
public class work {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ingresodatos ing=new ingresodatos();
ing.ingreso();
triangulo_isoseles obj=new triangulo_isoseles(ing.getladoA(),ing.getladoB(),ing.getladoC());
obj.triangulo();
}
}
2.- IngresaDatos
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class ingresodatos {
int a,b,c;
void ingreso()
{
c=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO C (BASE): ",""));
a=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO A: ",""));
b=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO B: ",""));
}
public int getladoA()
{
return a;
}
public int getladoB()
{
return b;
}
public int getladoC()
{
return c;
}
}
3.- triangulo_isoseles
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author kEHCKSOFT
*/
public class triangulo_isoseles {
//public int catetoA,catetoB,
public double a, b, c; // tamaño de los lados
public double A, B, C; // angulos
public double suma;
//MI CONSTRUCTOR
triangulo_isoseles(int LadoA,int LadoB,int LadoC)
{
a=LadoA;
b=LadoB;
c=LadoC;
}
void triangulo()
{
A = Math.acos( (b * b + c * c - a * a) / (2 * b * c)) * 180 / Math.PI;
B = Math.acos( (a * a + c * c - b * b) / (2 * a * c)) * 180 / Math.PI;
C = Math.acos( (a * a + b * b - c * c) / (2 * a * b)) * 180 / Math.PI;
suma = A + B + C;
JOptionPane.showMessageDialog(null,"Los lados son = [ " + a + ", " + b + ", " +c + "]\n "
+ "Los angulos son = [ " + A + ", " + B + ", " +C + "]\n"
+"La suma de sus angulos es = " + suma);
if (A != B && B != C && C != A)
JOptionPane.showMessageDialog(null,"Es un triangulo escaleno");
}
}
}
}
}
}
4.- Area
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class area {
double area1,base,altura,basetriangulorectangulo,lado;
area(double a, double c)
{
lado=a;
base=c;
}
void trianguloisoseles()
{
basetriangulorectangulo=base/2;//La altura de un triángulo isósceles divide a la base en dos segmentos iguales.
altura=Math.sqrt(Math.pow(lado, 2)-Math.pow(basetriangulorectangulo, 2));
area1=(base*altura)/2;
JOptionPane.showMessageDialog(null,"El area del Triangulo isoseles es: "+area1);
}
}
5.- Perimetro
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class perimetro {
double lado,base,perimetro1;
perimetro(double a, double c)
{
lado=a;
base=c;
}
void isoseles()
{
perimetro1=(2*lado)+base;
JOptionPane.showMessageDialog(null,"El perímetro del triangulo Isoseles es..."+perimetro1);
}
}
He creado 5 clases están enumeradas...!
1.- Work (Main)
package trabajo;
/**
*
* @author KEHACKSOFT
*/
public class work {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
ingresodatos ing=new ingresodatos();
ing.ingreso();
triangulo_isoseles obj=new triangulo_isoseles(ing.getladoA(),ing.getladoB(),ing.getladoC());
obj.triangulo();
}
}
2.- IngresaDatos
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class ingresodatos {
int a,b,c;
void ingreso()
{
c=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO C (BASE): ",""));
a=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO A: ",""));
b=Integer.parseInt(JOptionPane.showInputDialog("Ingresa LADO B: ",""));
}
public int getladoA()
{
return a;
}
public int getladoB()
{
return b;
}
public int getladoC()
{
return c;
}
}
3.- triangulo_isoseles
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author kEHCKSOFT
*/
public class triangulo_isoseles {
//public int catetoA,catetoB,
public double a, b, c; // tamaño de los lados
public double A, B, C; // angulos
public double suma;
//MI CONSTRUCTOR
triangulo_isoseles(int LadoA,int LadoB,int LadoC)
{
a=LadoA;
b=LadoB;
c=LadoC;
}
void triangulo()
{
A = Math.acos( (b * b + c * c - a * a) / (2 * b * c)) * 180 / Math.PI;
B = Math.acos( (a * a + c * c - b * b) / (2 * a * c)) * 180 / Math.PI;
C = Math.acos( (a * a + b * b - c * c) / (2 * a * b)) * 180 / Math.PI;
suma = A + B + C;
JOptionPane.showMessageDialog(null,"Los lados son = [ " + a + ", " + b + ", " +c + "]\n "
+ "Los angulos son = [ " + A + ", " + B + ", " +C + "]\n"
+"La suma de sus angulos es = " + suma);
if (A != B && B != C && C != A)
JOptionPane.showMessageDialog(null,"Es un triangulo escaleno");
}
}
}
}
}
}
4.- Area
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class area {
double area1,base,altura,basetriangulorectangulo,lado;
area(double a, double c)
{
lado=a;
base=c;
}
void trianguloisoseles()
{
basetriangulorectangulo=base/2;//La altura de un triángulo isósceles divide a la base en dos segmentos iguales.
altura=Math.sqrt(Math.pow(lado, 2)-Math.pow(basetriangulorectangulo, 2));
area1=(base*altura)/2;
JOptionPane.showMessageDialog(null,"El area del Triangulo isoseles es: "+area1);
}
}
5.- Perimetro
package trabajo;
import javax.swing.JOptionPane;
/**
*
* @author KEHACKSOFT
*/
public class perimetro {
double lado,base,perimetro1;
perimetro(double a, double c)
{
lado=a;
base=c;
}
void isoseles()
{
perimetro1=(2*lado)+base;
JOptionPane.showMessageDialog(null,"El perímetro del triangulo Isoseles es..."+perimetro1);
}
}
domingo, 12 de septiembre de 2010
C sharp: Busqueda de un Numero en un Array
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{//la variable "cont" me almacenara el numero de veces que un numero se repite...
//la variable "num" me almacena el numero buscado...
//Creao mi array que me almacenara la cantidad de numeros ingresado por teclado
public int cont,num;
public int[] array1;
//Creo el constructor inicializando los valores....
Program()
{
cont = 0;
num = 0;
array1 = new int[50];//le asigno 50 espacios a mi array
}
//Mi metodo Principal(Main) aqui creo el objeto que me llamara al Metodo ingreso...
static void Main(string[] args)
{
Program obj = new Program();
obj.ingreso();
}
void ingreso()
{
for (int i = 0; i < array1.Length; i++)
{
Console.WriteLine("Ingresa Nº: " + (i + 1));
array1[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine("Buscas Algun Número?... Escribelo");
num = int.Parse(Console.ReadLine());
for (int i = 0; i < array1.Length; i++)
{
if (num == array1[i])//busco en mi array numero iguales
{
cont++;
//almaceno el numero que se esta repitiendo en otro array
}
}
Console.WriteLine("El número " + num + " se repite " + cont + " veces.");
Console.ReadKey();
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{//la variable "cont" me almacenara el numero de veces que un numero se repite...
//la variable "num" me almacena el numero buscado...
//Creao mi array que me almacenara la cantidad de numeros ingresado por teclado
public int cont,num;
public int[] array1;
//Creo el constructor inicializando los valores....
Program()
{
cont = 0;
num = 0;
array1 = new int[50];//le asigno 50 espacios a mi array
}
//Mi metodo Principal(Main) aqui creo el objeto que me llamara al Metodo ingreso...
static void Main(string[] args)
{
Program obj = new Program();
obj.ingreso();
}
void ingreso()
{
for (int i = 0; i < array1.Length; i++)
{
Console.WriteLine("Ingresa Nº: " + (i + 1));
array1[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine("Buscas Algun Número?... Escribelo");
num = int.Parse(Console.ReadLine());
for (int i = 0; i < array1.Length; i++)
{
if (num == array1[i])//busco en mi array numero iguales
{
cont++;
//almaceno el numero que se esta repitiendo en otro array
}
}
Console.WriteLine("El número " + num + " se repite " + cont + " veces.");
Console.ReadKey();
}
}
}
jueves, 8 de julio de 2010
C# : GENERADOR DE PAGINAS WEB 1.0 (PROYECTO FINAL)
-->
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using c = System.Console;
using System.IO;
namespace generador
{
public class Program
{
#region "VARIABLES GLOBALES"
string[] GUARDAR;//aqui guardare todo el codigo fuente
string[] nombpaguardar;
string[] html={"<HTML xmlns=\"http://www.w3.org/1999/xhtml\">","</HTML>"};
string[] head={"<HEAD>","</HEAD>"};
string meta = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />";
string[] title={"<TITLE>","</TITLE>"};
string[] body = { "<BODY>", "</BODY>" };
string[] bgcolor;
string[] div = { "<DIV>", "</DIV>" };
string aligntem;
string[] table = { "<TABLE>", "</TABLE>" };
string[] tr = { "<TR>", "</TR>" };
string[] td = { "<TD>", "</TD>" };
string[] background;
string[] text;
string[] marquee = { "<MARQUEE>", "</MARQUEE>" };
string[] titulo;
string[] tema;
string[] texto;
string retornocar;
int numerocontador;
#endregion
#region "CONSTRUCTOR"
public Program(int nu)
{
numerocontador = 0;
GUARDAR = new string[nu];
nombpaguardar = new string[nu];
titulo = new string[nu];
tema = new string[nu];
texto = new string[nu];
bgcolor = new string[nu];
text=new string[nu];
background = new string[nu];
aligntem = "";
}
#endregion
#region "METODO NUEVO"
void nuevo(int n)
{
for (int i = 0; i <n;i++)
{
numerocontador = i;
c.WriteLine("Ingresa el nombre de tu página número {0} Ejemplo: Index.html", i + 1);
nombpaguardar[i] = c.ReadLine();
c.WriteLine("Ingresa el Titulo de tu página número {0}", i + 1);
titulo[i] = c.ReadLine();
c.WriteLine("Ingresa Tema del texto");
tema[i] = c.ReadLine();
c.WriteLine("Escribe un Texto para tu página Web, por favor escribe de corrido...");
texto[i] = c.ReadLine();
generador();
retocar();
//Guardar el Documento
StreamWriter st = new StreamWriter("C:\\Documents and Settings\\All Users\\Escritorio\\" + nombpaguardar[i]);
st.WriteLine("");
st.WriteLine(GUARDAR[i]);
st.WriteLine("");
st.Close();
}
}
#endregion
#region "METODO GENERADOR SIMPLE"
void generador()
{
GUARDAR[numerocontador] = html[0] + head[0] + meta + title[0] + titulo[numerocontador] + title[1] + head[1] + body[0] + "<BR><MARQUEE><CENTER><H2>" + tema[numerocontador] + "</H2></CENTER></MARQUEE><BR><P>" + "<DIV align=\"justify\">"+texto[numerocontador]+" </DIV>" + body[1] + html[1];
}
#endregion
#region "METODO RETOCAR"
void retocar()
{
c.WriteLine();
c.WriteLine();
c.WriteLine("¿Deseas darle algunos retoques al código generado?..... SI-NO");
c.WriteLine();
string rsp = c.ReadLine().ToLower();
c.WriteLine();
c.WriteLine();
switch (rsp)
{
case "si": retocar_si();
break;
case "no": retocar_no();
break;
default: c.WriteLine("Valor desconocido");
break;
}
}
#endregion
#region "METODO RETOCAR SI"
void retocar_si()
{
c.WriteLine("Para el Color del FONDO de la página escriba una combinación Hexadecimal (Ejemplo: #CC0085)");
string color = c.ReadLine().ToUpper();
c.WriteLine("Para el Color del TEXTO de la página escriba una combinación Hexadecimal (Ejemplo: #FF10FF)");
string colortxt = c.ReadLine().ToUpper();
c.WriteLine("Imagen del Fondo de la página");
string backgroundbd = c.ReadLine();
c.WriteLine("Alineación del Tema.... left-center-right");
string aligntema = c.ReadLine().ToLower();
c.WriteLine("Tamaño del Tema..... 1-Grande 2-Mediano 3-Pequeño");
string tamanotema = c.ReadLine().ToLower();
c.WriteLine("Escribe el numero de retornos de Carro a dejar entre el Tema y el Texto...");
int retornocarro = int.Parse(c.ReadLine());
c.WriteLine("Alineación del Texto.... left-center-right-justify");
string aligntexto = c.ReadLine().ToLower();
#endregion
#region "ALINEACION TEMA"
switch(aligntema)
{
case "left":aligntem=aligntema;
break;
case "center": aligntem = aligntema;
break;
case "right": aligntem = aligntema;
break;
default: aligntem = "left";
break;
}
#endregion
#region "TAMAÑO DEL TEMA"
switch(tamanotema)
{
case "1":tema[numerocontador]=(" <H1>"+tema[numerocontador]+" </H1>");
break;
case "2": tema[numerocontador] = ("<H3>" + tema[numerocontador] + "</H3>");
break;
case "3": tema[numerocontador] = ("<H5>" + tema[numerocontador] + "</H5>");
break;
default:c.WriteLine("Dato Incorrecto!");
break;
}
#endregion
#region "RETORNOS DE CARRO ENTRE EL TEMA Y EL TEXTO"
for (int i = 0; i
-->< retornocarro; i++)
{
retornocar = retornocar + "<BR>";
}
#endregion
#region "TRATAMIENTO DEL BODY"
bgcolor[numerocontador] = color;//atributo body
text[numerocontador] = colortxt;//atributo body
background[numerocontador] = backgroundbd;//atributo body
body[numerocontador] = ("<BODY bgcolor=\"" + bgcolor[numerocontador] + "\" text=\""+text[numerocontador] +"\" background=\""+background[numerocontador]+"\" link=\"#FF0000\" vlink=\"#CCFF00\" alink=\"#00FFFF\">");//forma HTML del Body
#endregion
#region "TRATAMIENTO DEL TEMA"
tema[numerocontador] = ("<MARQUEE><DIV align=\""+aligntem+"\">"+tema[numerocontador]+" </DIV></MARQUEE>");//forma HTML del tema
#endregion
#region "TRATAMIENTO DEL TEXTO"
//Modificamos el array table en la posicion 0
table[0]=(" <TABLE width=600 heigth=450 border=5 >");
td[0] = ("<TD width=100% heigth=100%>");
texto[numerocontador] = ("<CENTER>"+ table[0]+tr[0]+td[0]+" <DIV ALIGN=\""+aligntexto + "\">"+texto[numerocontador]+" </DIV>"+td[1]+tr[1]+table[1]+" </CENTER>");//forma HTML del Texto
#endregion
#region "GENERADOR DE CODIGO MODIFICADO"
GUARDAR[numerocontador] = html[0] + head[0] + meta + title[0] + titulo[numerocontador] + title[1] + head[1] + body[0] + tema[numerocontador] +retornocar+ texto[numerocontador] + body[1] + html[1];
#endregion
}
void retocar_no()
{ c.Clear(); c.WriteLine("Gracias por crear la Web!"); }
void salir()
{
c.ReadKey();
}
void Menu(int n)
{
c.WriteLine("\t\t░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
c.WriteLine("\t\t░░ ░░");
c.WriteLine("\t\t░░ MENU ░░");
c.WriteLine("\t\t░░ ░░");
c.WriteLine("\t\t░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░");
c.WriteLine();
c.WriteLine();
c.WriteLine("\t\tNuevo 1");
c.WriteLine();
c.WriteLine("\t\tSalir 2");
c.SetCursorPosition(25, 17);
string rsp = c.ReadLine();
switch (rsp)
{
case "1": nuevo(n);
break;
case "2": salir();
break;
default : c.WriteLine("Error valor no valido...");
break;
}
}
static void Main()
{
nombres nom = new nombres();
int numpag = int.Parse(c.ReadLine());
Program obj = new Program(numpag);
obj.Menu(numpag);
c.WriteLine();
c.WriteLine();
obj.salir();
}
}
public class nombres
{
public nombres()
{ requisitos(); }
void requisitos()
{
c.ForegroundColor = ConsoleColor.Red;
c.BackgroundColor = ConsoleColor.Yellow;
c.Clear();
c.Title = "Bienvenido al Generador de Paginas Web versión 1.0:::: \KEHACKSOFT/";
c.WriteLine("¿Cuántas Paginas se crearán?");
}
}
}
Suscribirse a:
Entradas (Atom)