Está en la página 1de 25

2013

INSTITUTO TECNOLOGICO DEL VALLLE DE OAXACA JONATHAN VALDIMIR ROJO ESPINOZA

[PROGRAMACIO II]
CARPETA DE EVIDENCIAS

------- PROYECTO: Calcular el tipo de triangulo --------

//------------------------- INTERFAZ
public partial class Form1 : Form { public Form1() { InitializeComponent(); }

private void btnNuevo_Click(object sender, EventArgs e) { /*txtA.Text = ""; txtB.Text = ""; txtC.Text = ""; lblTipo.Text = ""; txtA.Focus();*/ this.validacaja(txtbox); }

private void txtA_TextChanged(object sender, EventArgs e) { txtB.Focus(); } private void txtB_TextChanged(object sender, EventArgs e) { txtC.Focus(); } private void btnCalcular_Click(object sender, EventArgs e) { if (txtA.Text == "" && txtB.Text == "" && txtC.Text == "") { MessageBox.Show("Escribe los lados del trinagulo"); } //creacion de objetos para comunicar form y la clase // Calcular objTrin = new Calcular(); objTrin.LadoA = Convert.ToInt32(txtA.Text); objTrin.LadoB = Convert.ToInt32(txtB.Text); objTrin.LadoC = Convert.ToInt32(txtC.Text); // CALCULAR TIPO

objTrin.calcularTipo(); // EL METODO DON DE SA CALCULO lblTipo.Text = objTrin.Resultado;

//VALIDAR LA CAJAS DE TEXTO EN BLACO Y CREAR UN METODO QUE VALIDE K EL USUARIO NO INTRUDUSCA LETRAS // } private void Form1_Load(object sender, EventArgs e) { } private void txtA_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsNumber(e.KeyChar)) { e.Handled = true; MessageBox.Show("Solo se admiten datos numericos en este campo"); if (e.KeyChar == 13 && txtA.Text != string.Empty) { txtA.Text = string.Empty; txtA.Focus(); }

} private void validacaja(TextBox t) { t.Text = ""; //validacaja = new borrar; } private void txtB_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsNumber(e.KeyChar)) { e.Handled = true; MessageBox.Show("Solo se admiten datos numericos en este campo"); if (e.KeyChar == 13 && txtB.Text != string.Empty) { txtB.Text = string.Empty; txtB.Focus(); } } } private void txtC_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsNumber(e.KeyChar)) { e.Handled = true; MessageBox.Show("Solo se admiten datos numericos en este campo"); if (e.KeyChar == 13 && txtA.Text != string.Empty)

{ txtC.Text = string.Empty; txtC.Focus(); } } } public TextBox txtbox { get; set; } } }

//---- -------------------------CLASE
class Calcular { private float ladoA; //creacion de atribustos private float ladoB; private float ladoC; private string resultado; // metodo constructor public Calcular() { this.ladoA = 0; this.ladoB = 0; this.ladoC = 0; this.resultado = ""; } //propiedades para la clase interfas public float LadoA // LadoA Es el k se manejara en la interfas { set { this.ladoA = value; } } public float LadoB { set { this.ladoB = value; } } public float LadoC { set { this.ladoC = value; } } public String Resultado { get { return this.resultado; } } public void calcularTipo() if (this.ladoA == ladoB && this.ladoB == this.ladoC && this.ladoC == ladoA) this.resultado = "Equilatero"; else if (this.ladoA != ladoB && this.ladoB != this.ladoC && this.ladoC != ladoA) this.resultado = "Escaleno"; else this.resultado = "Isosceles";

} }

------- PROYECTO: Calcular factorial --------

//------------------------- INTERFAZ
public partial class frmFact : Form {Numero objnum; public frmFact() { InitializeComponent(); objnum=new Numero();

double valorI =1; for (int i=1; i <= Int64.Parse(txtFactorial.Text); i++) valorI*=i;

lblmos.Text = valorI.ToString(); txtFactorial.Text = " "; } } private void btnNuevo_Click(object sender, EventArgs e) { txtFactorial.Text= " "; } private void btn_Click(object sender, EventArgs e) { } } }

//------------------------- CLASE
class Numero { private int i; public int valorI { set { this.i = value; } get { return this.valorI; } } } ------- PROYECTO:

Nomina --------

//------------------------- INTERFAZ
public partial class Form1 : Form { Calculos cal; public Form1() { InitializeComponent(); cal = new Calculos(); } private void btnNuevo_Click(object sender, EventArgs e) { txtNombre.Text = ""; txtApellidoP.Text = ""; txtApellidoM.Text = ""; txtCosto.Text = ""; txtHoras.Text = ""; txtNombre.Focus(); txtAumento.Text = ""; txtSueldo.Text = ""; txtSueldoN.Text = ""; txtSueldo.Enabled = false; txtSueldoN.Enabled = false; txtAumento.Enabled = false; /*rbtnHonorarios.Text = ""; rbtnTitularA.TextChanged = ""; rbtnTitularB.Text = ""; rbtnTitularC.Text = "";*/ rbtnTitularA.Checked = false; rbtnTitularB.Checked = false; rbtnTitularC.Checked = false; rbtnHonorarios.Checked = false; } private void btnCalcular_Click(object sender, EventArgs e) { if (txtNombre.Text != "" && txtApellidoP.Text != "" && txtApellidoM.Text != "") { cal.Nombre = Convert.ToString(txtNombre.Text); cal.apellido1 = Convert.ToString(txtApellidoP.Text);

cal.apellido2 = Convert.ToString(txtApellidoM.Text); cal.tiempo = Convert.ToInt32(txtHoras.Text); cal.pago = Convert.ToInt32(txtCosto.Text) if (rbtnTitularA.Checked == true) { cal.AumentoTitular1(); txtSueldo.Text = cal.totaltitularA; txtAumento.Text = cal.CAumento; txtSueldoN.Text = cal.Sueldo_neto; } else if (rbtnTitularB.Checked == true) { cal.AumentoTitular2(); txtSueldo.Text = cal.totaltitularB; txtAumento.Text = cal.CAumento; txtSueldoN.Text = cal.Sueldo_neto; } else if (rbtnTitularC.Checked == true) { cal.AumentoTitular3(); txtSueldo.Text = cal.totaltitularC; txtAumento.Text = cal.CAumento; txtSueldoN.Text = cal.Sueldo_neto; } else if (rbtnHonorarios.Checked == true) { cal.AumentoHonorario(); txtSueldo.Text = cal.totaltitularH; txtAumento.Text = cal.CAumento; txtSueldoN.Text = cal.Sueldo_neto; } } if (txtNombre.Text == "" && txtApellidoP.Text == "" && txtApellidoM.Text == "" && txtHoras.Text == "" && txtCosto.Text == "") MessageBox.Show("ALTO! NO INGRESO NINGUN DATO"); else if (txtNombre.Text == "") MessageBox.Show("ALTO! Le falto ingresar el nombre"); else if (txtApellidoP.Text == "") MessageBox.Show("ALTO! Falta el apellido paterno"); else if (txtApellidoM.Text == "") MessageBox.Show("ALTO! Falta el apellido materno"); else if (txtHoras.Text == "") MessageBox.Show("ALTO! Falta ingresar las horas trabajadas"); else if (txtCosto.Text == "") MessageBox.Show("ALTO! No ingreso el costo"); } private void rbtnTitularA_CheckedChanged(object sender, EventArgs e) { cal.AumentoTitular1(); } private void rbtnTitularB_CheckedChanged(object sender, EventArgs e) { cal.AumentoTitular2() } private void rbtnTitularC_CheckedChanged(object sender, EventArgs e) {

cal.AumentoTitular3(); } private void rbtnHonorarios_CheckedChanged(object sender, EventArgs e) { cal.AumentoHonorario(); } private void Form1_Load(object sender, EventArgs e) { txtSueldo.Enabled = false; txtSueldoN.Enabled = false; txtAumento.Enabled = false; } private void txtNombre_KeyPress(object sender, KeyPressEventArgs e) { char caracteres; caracteres = e.KeyChar; if (Char.IsLetter(caracteres)) { e.Handled = false; } else if (Char.IsControl(caracteres)) { e.Handled = false; } else { e.Handled = true; } } private void txtApellidoP_KeyPress(object sender, KeyPressEventArgs e) { char caracteres; caracteres = e.KeyChar; if (Char.IsLetter(caracteres)) { e.Handled = false; } else if (Char.IsControl(caracteres)) { e.Handled = false; } else { e.Handled = true; } } private void txtApellidoM_KeyPress(object sender, KeyPressEventArgs e) { char caracteres; caracteres = e.KeyChar; if (Char.IsLetter(caracteres)) { e.Handled = false; } else if (Char.IsControl(caracteres)) { e.Handled = false; } else { e.Handled = true; }

} private void txtHoras_KeyPress(object sender, KeyPressEventArgs e) { char numeros; numeros = e.KeyChar; if (Char.IsDigit(numeros)) { e.Handled = false; } else if (Char.IsControl(numeros)) { e.Handled = false; } else { e.Handled = true; } } private void txtCosto_KeyPress(object sender, KeyPressEventArgs e) { char numeros; numeros = e.KeyChar; if (Char.IsDigit(numeros)) { e.Handled = false; } else if (Char.IsControl(numeros)) { e.Handled = false; } else { e.Handled = true; } } } }

//------------------------- CLASE
class Calculos { private private private private private private private private private

String nombre; String apellidop; String apellidom; float hora,horas; float costo,costos; double resultado, resultado2,sueldneto; String sueldo; String aumento; String SueldoNeto;

public Calculos(){ nombre=""; apellidop=""; apellidom=""; hora=0; horas=0; costo=0;

costos=0; resultado=0; resultado2 = 0; sueldneto=0; sueldo=""; aumento=""; SueldoNeto=""; } public String Nombre { set { this.nombre = value; }} public String apellido1 { set { this.apellidop = value; }} public String apellido2 { set { this.apellidom = value; }} public float tiempo { set { this.horas = value; } } public float pago { set { this.costos = value; } } public String totaltitularA{ get { return this.sueldo;//nos devuelve el sueldo } } public String totaltitularB { get { return this.sueldo;//nos devuelve el sueldo } } public String totaltitularC { set { this.sueldo = value; } get { return this.sueldo;//nos devuelve el sueldo } }

public String totaltitularH { get { return this.sueldo;//nos devuelve el sueldo } } public String CAumento { set { this.aumento = value } get { return this.aumento; } } public String Sueldo_neto { set {this.SueldoNeto = value;} get {return this.SueldoNeto; } } public void AumentoTitular1() { for (hora = 0; hora < horas;hora++ ) for(costo = 0; costo < costos;costo++ ) resultado = horas * costos; resultado2 = resultado * .20; sueldneto = resultado + resultado2; sueldo = Convert.ToString(resultado); aumento = Convert.ToString(resultado2); SueldoNeto = Convert.ToString(sueldneto); } public void AumentoTitular2() { for (hora = 0; hora < horas; hora++) for (costo = 0; costo < costos; costo++) resultado = horas * costos; resultado2 = resultado * .25; sueldneto = resultado + resultado2; sueldo = Convert.ToString(resultado); aumento = Convert.ToString(resultado2); SueldoNeto = Convert.ToString(sueldneto); } public void AumentoTitular3(){ for (hora = 0; hora < horas; hora++) for (costo = 0; costo < costos; costo++) resultado = horas * costos; resultado2 = resultado * .30; sueldneto = resultado + resultado2; sueldo = Convert.ToString(resultado); aumento = Convert.ToString(resultado2); SueldoNeto = Convert.ToString(sueldneto) } public void AumentoHonorario() { for (hora = 0; hora < horas; hora++) for (costo = 0; costo < costos; costo++) resultado = horas * costos; resultado2 = resultado * 10 / 100; sueldneto = resultado + resultado2; sueldo = Convert.ToString(resultado); aumento = Convert.ToString(resultado2);

SueldoNeto = Convert.ToString(sueldneto); } } }

------- PROYECTO:

Encriptar --------

//------------------------- INTERFAZ
public partial class Form1 : Form { Ecrip obn;

public Form1() { InitializeComponent(); obn = new Ecrip(); }

private void button1_Click(object sender, EventArgs e) { textBox2.Text = obn.encript(textBox1.Text); } private void button2_Click(object sender, EventArgs e) { textBox3.Text = obn.desencritar(textBox2.Text); } } }

//------------------------- CLASE
using System;

using using using using

System.Collections.Generic; System.Linq; System.Text; System.Security.Cryptography;

namespace encriptar { class Ecrip { string key = "MIKEY"; public string encript(string texto) { byte[] keyArray; byte[] arreglo_a_cifrar = UTF8Encoding.UTF8.GetBytes(texto); MD5CryptoServiceProvider hashmd5 = new MD5CryptoServiceProvider(); keyArray = hashmd5.ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); hashmd5.Clear(); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tdes.Key = keyArray; tdes.Mode = CipherMode.ECB; tdes.Padding = PaddingMode.PKCS7; ICryptoTransform ctrasform = tdes.CreateEncryptor();//iniciamos la trasformacion de la cadena byte[] ArrayResultado = ctrasform.TransformFinalBlock(arreglo_a_cifrar, 0, arreglo_a_cifrar.Length);//arreglo de bytes donde se guardo la cadena de cifrado tdes.Clear();//LIMPIAR TDES return Convert.ToBase64String(ArrayResultado, 0, ArrayResultado.Length);//se regresa el reultado en forma de cadena } public string desencritar(string textoencriptado) { byte[] keyArray; byte[] Array_a_desifrar = Convert.FromBase64String(textoencriptado); MD5CryptoServiceProvider hashmds = new MD5CryptoServiceProvider(); keyArray = hashmds.ComputeHash(UTF8Encoding.UTF8.GetBytes(key)); hashmds.Clear(); TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider(); tdes.Key = keyArray; tdes.Mode = CipherMode.ECB; tdes.Padding = PaddingMode.PKCS7; ICryptoTransform CTrasform = tdes.CreateDecryptor(); byte[] resultArray = CTrasform.TransformFinalBlock(Array_a_desifrar, 0, Array_a_desifrar.Length); tdes.Clear(); return UTF8Encoding.UTF8.GetString(resultArray);

} } }

------ PROYECTO: Chat --------

//------------------------- INTERFAZ SERVIDOR


using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.Sockets; namespace Server { public partial class Form1 : Form { TcpListener servidor = new TcpListener(IPAddress.Any,1234);//Nos va decir desde que puerto va escuchar nuestro programa y el puerto TcpClient cliente_aceptado = null; public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { if (servidor.Pending()) { TcpClient cliente = servidor.AcceptTcpClient();//permitir crear todos nuestros clientes y checa si hay conexion cliente_aceptado = cliente; timer2.Start(); } } private void btniniciar_Click(object sender, EventArgs e) { servidor.Start(); timer1.Start(); } private void btnEnviar_Click(object sender, EventArgs e)

{ if (txtMensaje.Text != "") { Mensajes.Enviar(cliente_aceptado, txtMensaje.Text); // txtChat.Text += "Yo:" + txtMensaje.Text + "\n"; // txtMensaje.Text = ""; } } private void timer2_Tick(object sender, EventArgs e) { try { if (cliente_aceptado.Available > 0) { txtChat.Text += "Cliente:" + Mensajes.Recibir(cliente_aceptado) + "\n"; } } catch (Exception) { } } } }

//------------------------- INTERFAZ CLIENTE


using using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Net; System.Net.Sockets;

namespace Client { public partial class Form1 : Form { public static TcpClient Cliente = new TcpClient(); public Form1() { InitializeComponent(); } private void btnconectar_Click(object sender, EventArgs e) { try { Cliente.Connect(IPAddress.Parse("192.168.56.1"), 1234); lblestado.Text = "Conectado"; if (Cliente.Connected) { timer2.Start(); } }

catch (Exception) { lblestado.Text = "No conectado"; } } private void btnEnviar_Click(object sender, EventArgs e) if (txtMsj.Text != "") { Msj.Enviar(Cliente, txtMsj.Text); txtChat.Text += "cliente:"+" " + txtMsj.Text + "\n"; txtMsj.Text = ""; } } private void timer2_Tick(object sender, EventArgs e) { try { {

if (Cliente.Available > 0) { txtChat.Text += "cliente" + Msj.Recibir(Cliente) + "\n"; } } catch (Exception) { } } } }

//------------------------- CLASE SERVIDOR


using System; using using using using using System.Collections.Generic; System.Linq; System.Text; System.Net.Sockets; System.IO;//entrada y salidad de datos

namespace Server { class Mensajes { public static void Enviar(TcpClient cliente,String dato) { try//sirve para manejar execciones { NetworkStream netStream = cliente.GetStream(); StreamWriter escribir = new StreamWriter(netStream);//para pode escribir escribir.WriteLine(dato); escribir.Flush(); } catch (Exception) { } } public static String Recibir(TcpClient cliente) { try { NetworkStream netStream = cliente.GetStream(); StreamReader leer = new StreamReader(netStream);

return leer.ReadLine(); } catch (Exception) { return ""; } } } }

//------------------------- CLASE CLIENTE


using using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Net; System.Net.Sockets;

namespace Client { public partial class Form1 : Form { public static TcpClient Cliente = new TcpClient(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void btnconectar_Click(object sender, EventArgs e) { try { Cliente.Connect(IPAddress.Parse("192.168.56.1"), 1234); lblestado.Text = "Conectado"; if (Cliente.Connected) { timer2.Start(); } } catch (Exception) { lblestado.Text = "No conectado"; } } private void btnEnviar_Click(object sender, EventArgs e) { if (txtMsj.Text != "") { Msj.Enviar(Cliente, txtMsj.Text); txtChat.Text += "cliente:"+" " + txtMsj.Text + "\n"; txtMsj.Text = ""; } } private void timer2_Tick(object sender, EventArgs e) {

try { if (Cliente.Available > 0) { txtChat.Text += "cliente" + Msj.Recibir(Cliente) + "\n"; } } catch (Exception) { } } } } ------- PROYECTO:

Control De cyber --------

//------------------------- INTERFAZ SERVIDOR


using using using using using using using using using using System; System.Collections.Generic; System.ComponentModel; System.Data; System.Drawing; System.Linq; System.Text; System.Windows.Forms; System.Net; System.Net.Sockets;

using System.Diagnostics; namespace Gestionpc { public partial class Form1 : Form { TcpListener servidor = new TcpListener(IPAddress.Any, 1234);//Nos va decir desde que puerto va escuchar nuestro programa y el puerto TcpClient cliente_aceptado = null; Tiempo objtime; string costo; int a; float cmins;

public Form1()

{ InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { servidor.Start(); timer2.Start(); txtcost.Text = costo; } public String Costo { set { costo = value; } get { return costo; } } private void timer1_Tick(object sender, EventArgs e) { timer1.Interval = 10; objtime.Calcular(); txttime.Text = objtime.Salehora.ToString() + ":" + objtime.Saleminutos.ToString() + ":" + objtime.Salesegundos.ToString(); // txttime.Text = objtime.Salesegundos.ToString()+":"+objtime.Saleminutos.ToString()+":"+objtime.Sa lehora.ToString(); txttot.Text = objtime.Total; } private void pibPC1_Click(object sender, EventArgs e) {

if (timer1.Enabled == false) { timer4.Start(); timer1.Start(); } else timer1.Stop();

a = System.Int32.Parse(txtcost.Text); objtime = new Tiempo(a); cmins = a / 60; objtime.borrar(); } private void pibPC1_DoubleClick(object sender, EventArgs e) { timer1.Stop(); lblseg.Text = "00"; lblmin.Text = "00";

lblhrs.Text = "00"; txtcost.Text = ""; txttot.Text = ""; } private void txtcost_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsNumber(e.KeyChar)) { e.Handled = true; MessageBox.Show("Solo se admiten datos numericos en este campo"); if (e.KeyChar == 13 && txtcost.Text != string.Empty) { txtcost.Text = string.Empty; txtcost.Focus(); } } } private void timer2_Tick_1(object sender, EventArgs e) { if (servidor.Pending()) { TcpClient cliente = servidor.AcceptTcpClient();//permitir crear todos nuestros clientes y checa si hay conexion cliente_aceptado = cliente; timer3.Start(); } } private void timer3_Tick(object sender, EventArgs e) { try { if (cliente_aceptado.Available > 0) { txttot.Text = Envio.Recibir(cliente_aceptado); txttime.Text = Envio.Recibir(cliente_aceptado); // lblmin.Text = Envio.Recibir(cliente_aceptado); // lblhrs.Text = Envio.Recibir(cliente_aceptado); } } catch (Exception) { } } private void timer4_Tick(object sender, EventArgs e) { if (txttot.Text != "")//&& txttime.Text != "" { Envio.Enviar(cliente_aceptado, txttime.Text); Envio.Enviar(cliente_aceptado, txttot.Text); } } }

//------------------------- INTERFAZ CLIENTE


using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Net; using System.Net.Sockets; namespace Cliente { public partial class Form1 : Form { public static TcpClient Cliente = new TcpClient(); public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { try { Cliente.Connect(IPAddress.Parse("192.168.56.1"), 1234); lblEstado.Text = "Conectado"; if (Cliente.Connected) { timer1.Start(); timer2.Start(); } } catch (Exception) { lblEstado.Text = "No Conectado"; }

} private void timer1_Tick(object sender, EventArgs e) { try { if (Cliente.Available > 1) { txttot.Text = Envio.Recibir(Cliente); txttime.Text = Envio.Recibir(Cliente); } } catch (Exception) { } } }

//------------------------- CLASE SERVIDOR


using using using using using using System; System.Collections.Generic; System.Linq; System.Text; System.IO; System.Net.Sockets;

namespace Gestionpc { class Envio { public static void Enviar(TcpClient cliente, String total="") { try//sirve para manejar execciones { NetworkStream netStream = cliente.GetStream(); StreamWriter escribir = new StreamWriter(netStream);//para poder escribir escribir.WriteLine(total); escribir.Flush(); } catch (Exception) { } }

public static String Recibir(TcpClient cliente) { try { NetworkStream netStream = cliente.GetStream(); StreamReader leer = new StreamReader(netStream); return leer.ReadLine(); } catch (Exception) { return ""; } } } }

//------------------------- CLASE SERVIDOR TIEMPO


class Tiempo { private private private private private private private private private private private private private int minuto; int minutost; int segundo; int milesima; int hora; float total; string tot; float costom; int salehora; int salemin; int saleseg; int salemil; int costo;

public int Salehora { get { return salehora; } } public int Saleminutos { get { return salemin; } } public int Salesegundos { get { return saleseg; } } public String Total { get { return tot; } } public int Costo { set { costo=value; } }

public Tiempo(float dato) { milesima = 0; segundo = 0; minuto = 0; hora = 0; minutost = 0; salehora = 0; salemin = 0; saleseg = 0; salemil = 0; total = 0; costom = dato/60; } public void borrar() { milesima = 0; segundo = 0; minuto = 0; hora = 0; minutost = 0; salehora = 0; salemin = 0; saleseg = 0; salemil = 0; total = 0; } public void Calcular() {

milesima += 1; salemil = milesima; if (milesima ==

{ segundo += 1; saleseg = segundo; milesima = 0; if (segundo == 60) { minuto += 1; minutost += 1; salemin = minuto; segundo = 0; if (minuto == 60) { hora += 1; salehora = hora; minuto = 0; } } }

total = costom * minutost; decimal redondear = decimal.Round(Convert.ToDecimal(total), 1); tot = "$ " + redondear.ToString(); } } }

//------------------------- CLASE CLIENTE


using using using using using using System; System.Collections.Generic; System.Linq; System.Text; System.IO; System.Net.Sockets;

namespace Cliente { class Envio {

public static String Recibir(TcpClient cliente) { try { NetworkStream netStream = cliente.GetStream(); StreamReader leer = new StreamReader(netStream); return leer.ReadLine(); } catch (Exception) { return ""; } } } }

------- PROYECTO:

Tienda (Conexin con una base de datos con mysql) --------

También podría gustarte