Posts Tagged ‘C#’
CSharp - Clase de conversiones de tipos
Written by lopezatienza on 17 Febrero 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
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - Leer un fichero
Written by lopezatienza on 13 Diciembre 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()
{
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - Clase Fichero (Tratamiento de ficheros)
Written by lopezatienza on 13 Diciembre 2009 – 23:01 -Aquí os dejo una clase de tratamiento de ficheros con las siguientes opciones entre otras:
- Apertura de ficheros.
- Cerrar ficheros.
- Lectura de ficheros.
- Escritura de ficheros.
- Existencia de ficheros.
- Borrar ficheros.
- Búsqueda de palabras en ficheros.
- Búsqueda dicotómica.
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - Clase Convertir objetos en tipos de datos
Written by lopezatienza on 13 Diciembre 2009 – 22:38 -Aquí os dejo una clase para convertir objetos en tipos de datos, evitando las excepciones producidas por la conversión de datos en tipos de datos no compatibles.
using System;
using System.Windows.Forms;
using System.Collections.Generic;
using System.Text;
public abstract class Convertir
{
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - DataGridView + Select A Row + ContextMenuStrip
Written by lopezatienza on 8 Junio 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.
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - ListView Eventos, Funciones y otros
Written by lopezatienza on 18 Marzo 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:
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - Añadir estilo CSS a un DataGrid
Written by lopezatienza on 8 Marzo 2009 – 21:00 -He encontrado este interesante artículo en este link:
http://www.codeproject.com/KB/webforms/cssgrid.aspx
Introduction
It can be frustrating trying to apply CSS styles to .NET data grids - attempting to blindly apply styles does not usually work as expected, because of the way that the DataGrid is rendered to the browser. This article introduces some simple techniques to help get you started.
But first, why use styles at all? You could use the autoformat feature in Visual Studio .NET, but what happens when the "UI expert consultant" that your boss hired insists on extra spacing between the rows? You'll have to go to every grid on your project, and edit it. Using styles lets you control the appearance of all of your grids from a single place.
Tags: C#, CSharp
Posted in CSharp, Visual Basic .NET | 2 Comments »
CSharp - 101 Ejemplos en CSharp
Written by lopezatienza on 26 Enero 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
Tags: C#, CSharp
Posted in CSharp | No Comments »
CSharp - DataGrid with DataSet
Written by lopezatienza on 26 Diciembre 2008 – 9: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: C#, CSharp
Posted in CSharp | 2 Comments »
CSharp - Clase FTP
Written by lopezatienza on 22 Diciembre 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
Tags: C#, CSharp
Posted in CSharp | 2 Comments »
