Last updated by at .

CSharp – Clase de conversiones de tipos

Written by lopezatienza on 17/02/2010 – 23:10 -

Buenas a todos.

Aquí os dejo una clase abstracta para realizar conversiones de tipos.

Las conversiones que puede realizar son las siguientes:

  • String to Bool
  • Object to Bool
  • Object to DateTime
  • String to Int
  • Object to Int
  • Decimal to String
  • Object to String

Read more »


Tags: ,
Posted in CSharp | No Comments »

CSharp – Leer un fichero

Written by lopezatienza on 13/12/2009 – 23:17 -

Aquí os dejo el código en C# para poder leer desde un fichero:

using System;

using System.IO;

 

class Test

{

    public static void Main()

    {

Read more »


Tags: ,
Posted in CSharp | No Comments »

CSharp – DataGridView + Select A Row + ContextMenuStrip

Written by lopezatienza on 08/06/2009 – 12:43 -

Aqui os dejo un ejemplo de cómo seleccionar una fila de un control DataGridView pulsando el botón derecho para que aparezca el ContextMenu.

Si de normal pulsaramos con el botón derecho encima de la fila que deseemos y seleccionamos del ContextMenu cualquier opción, en la siguiente función saltaría una excepción ya que intentamos acceder a la propiedad "dgPrueba.SelectedRows[0].Index", puesto que con el botón derecho NO se selecciona la Row.

En este ejemplo tenemos en nuestro formulario un DataGridView llamado dgPrueba y un ContextMenu llamado menuPRUEBA.

De un primer momento tendremos asociados el dgPrueba con el ContextMenu, que sería lo más normal, en la Solución veremos cómo no se precisa.

Read more »


Tags: ,
Posted in CSharp | No Comments »

CSharp – ListView Eventos, Funciones y otros

Written by lopezatienza on 18/03/2009 – 10:46 -

Voy a ir añadiendo en esta entrada funcionalidad de este componente cuando vaya investigandolo a fondo.

De momento decir que este componente proviene de System.Windows.Forms.ListView

La creación de este en el Designer sería algo así con 3 columnas:

Read more »


Tags: ,
Posted in CSharp | No Comments »

CSharp – 101 Ejemplos en CSharp

Written by lopezatienza on 26/01/2009 – 16:01 -

Microsoft ha puesto a disposición de todos los programadores de 101 Ejemplos de Programación en C#.


Estas descargas incluyen una compilación de ejemplos C# que demuestran varios aspectos importantes del lenguaje como: sintaxis, acceso a datos, Windows Forms, desarrollo web, servicios web, XML, seguridad, Framework, sistemas de archivos, entrada y salida de datos, interoperabilidad y migración, COM+, ADO.NET, y tópicos avanzados incluyendo gráficos con GDI+, remoting, serialización, MSMQ, y servicios Windows.


Sistemas operativos: TabletPC, Windows 2000, Windows 2000 Service Pack 2, Windows 2000 Service Pack 3, Windows 2000 Service Pack 4, Windows 98, Windows 98 Second Edition, Windows ME, Windows NT, Windows Server 2003, Windows XP, Windows XP Media Center Edition


Aplicaciones para clientes con Visual Studio .NET 2003


Nota: Algunos ejemplos requieren acceso a la base de datos Northwind en SQL Server o Microsoft Data Engine.


Descarga de archivo

http://download.microsoft.com/download/6/4/7/6474467e-b2b7-40ea-a478-1d3296e78adf/CSharp.msi (tamaño 6.578MB)

Más información en

http://www.microsoft.com/downloads/details.aspx?FamilyID=08e3d5f8-033d-420b-a3b1-3074505c03f3&DisplayLang=en


Autor: Antonio Lopez Atienza


Tags: ,
Posted in CSharp | No Comments »

CSharp – DataGrid with DataSet

Written by lopezatienza on 26/12/2008 – 09:52 -

Aquí os dejo un ejemplo de enlazar un DataGrid con DataSet.

Este ejemplo lo he tomado de: aquí

This is a simple C# Program that illustrate the usage of DataGrid with DataSet.

Create Database and Table accordingly.

/*
 * Simple C# example to illustrate the usage of Dataset with DataGrid
 * Need to change the url and query accordingly
*/
 
Read more »


Tags: ,
Posted in CSharp | 2 Comments »

CSharp – Clase FTP

Written by lopezatienza on 22/12/2008 – 17:23 -

Aquí os dejo una clase FTP:

 

 

using System;

using System.Net;

using System.IO;

using System.Text;

using System.Net.Sockets;

using System.Diagnostics;

 

namespace FtpService

{ Read more »


Tags: ,
Posted in CSharp | 2 Comments »

CSharp – Clase Ping

Written by lopezatienza on 22/12/2008 – 17:19 -

Aquí os dejo una clase Ping para hacer comprabaciones de Ping TCP/IP

using System;

using System.Drawing;

using System.Collections;

using System.Windows.Forms;

using System.Net;

using System.Net.Sockets;

using System.Runtime.InteropServices;

using System.Text; 

namespace NombreDelNamespace Read more »


Tags: ,
Posted in CSharp | No Comments »

CSharp – Comunicacion PPC ActiveSync con openNETCF

Written by lopezatienza on 18/12/2008 – 13:06 -

A continuación muestro el código de un ejemplo de Comunicación con un PPC mediante ActiveSync con openNETCF

using System;

using System.Drawing;

using System.Collections;

using System.ComponentModel;

using System.Windows.Forms; Read more »


Tags: ,
Posted in CSharp | 3 Comments »
RSS
MCC D5E