<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3608165024229233384</id><updated>2025-06-19T19:27:27.912-07:00</updated><category term="Programacion C#"/><category term="Tutorial C#"/><category term="C# Blog"/><category term="C#"/><category term="Ejercicios C#"/><category term="Blog C#"/><category term="Aprender C#"/><category term="C# Blog en Español"/><category term=".NET"/><category term="Cargar Imagen PictureBox c#"/><category term="Cargar imagen c#"/><category term="Programacion"/><category term="Tips"/><category term="Tutorial de C#"/><category term=".NET Framework"/><category term="Añadir Items a Listbox C#"/><category term="Añadir Parametros SQL C#"/><category term="C# Blog Español"/><category term="C# Ejercicios"/><category term="C# y SQL"/><category term="Chart c#"/><category term="Conexion a Base de Datos"/><category term="Control Chart C#"/><category term="Crear DataTable desde codigo"/><category term="DataTable"/><category term="Datagridview Desde Codigo"/><category term="Eliminar Comillas Dobles C#"/><category term="Encriptacion 2 Vias C#"/><category term="Encriptar C Sharp"/><category term="Encriptar C#"/><category term="Encriptar MD5 C#"/><category term="Encriptar Windows Form"/><category term="Evitar Cierre Aplicacion C#"/><category term="Form"/><category term="Introduccion a .NET"/><category term="Keypress"/><category term="Leer CSV C#"/><category term="Leer txt c#"/><category term="Llenar dropdownlist c#"/><category term="Llenar un datatable desde codigo"/><category term="MDI Parent"/><category term="Modificar Datagridview"/><category term="No repetir MDI Parent"/><category term="Ocultar Columna Datagridview C#"/><category term="Pocket PC"/><category term="Primeros Pasos"/><category term="Progracion C#"/><category term="Programacion con C#"/><category term="Programacion.NET"/><category term="Resumen del Lenguaje C#"/><category term="SQLCommand C#"/><category term="Solo Numeros C#"/><category term="Tutoriales"/><category term="Verificar Aplicación Abierta C#"/><category term="Windows Mobile C#"/><category term="copia imagen c#"/><category term="datagridview c#"/><category term="ejercicos c#"/><category term="graficos c#"/><category term="list to datatable"/><category term="llenar dropdownlist con datos"/><category term="obtener valor columna datagriview c#"/><category term="openfiledialog c#"/><category term="sumar datagridview c#"/><category term="sumar datos datagridview"/><category term="validar email c#"/><title type='text'>C# Maniax - Tutorial C# .NET</title><subtitle type='html'>Programacion C# .NET, Ejemplos y Codigos Tutorial C# para Windows Form, ASP.NET, Windows Mobile y todo sobre tecnologia .NET de Microsoft .</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-378207476598622980</id><published>2012-12-12T09:55:00.002-08:00</published><updated>2020-07-29T23:50:19.436-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="datagridview c#"/><category scheme="http://www.blogger.com/atom/ns#" term="obtener valor columna datagriview c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Obtener Valor de una Celda especificando la Columna C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Un poco corto de tiempo, escribo este pequeño material que les ayudara a obtener un valor de un &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;strong&gt;&lt;span style=&quot;color: #cc0000; font-family: inherit;&quot;&gt;Tutorial C#&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; rows=&quot;10&quot;&gt;private void dgvEncontrados_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e)
{
     IDValor = Convert.ToInt32(miDataGridView.Rows[e.RowIndex].Cells[&quot;AQUILACOLUMNA&quot;].Value.ToString());
  SqlDataReader reader = &quot;EJECUTA UNA INSTRUCCION&quot;;
if (reader.Read())
   {
      &quot;Realiza alguna Acción&quot;;
   }
}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;Para explicar un poco como funciona el código, vemos que en los parámetros que son enviados por el evento &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/378207476598622980/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/12/obtener-valor-de-una-celda.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/378207476598622980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/378207476598622980'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/12/obtener-valor-de-una-celda.html' title='Obtener Valor de una Celda especificando la Columna C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7531367333045848638</id><published>2012-11-05T12:47:00.001-08:00</published><updated>2014-09-26T11:33:24.590-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="list to datatable"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Convertir Lista en Datatable C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Existen ocasiones en las que debemos trabajar con objetos del tipo lista genérica y si no tienes cierta experiencia usándolas o recorriendolas puede que en ocasiones sea hasta un poco difícil tratar con las mismas, sobre todo cuando tu no las generas ya sea porque utilices una Dll de un tercero o porque tu proyecto deba recibirlo como parámetro de algún WebService y no sepas internamente como esta construida, así que si deseas saber que es lo que tiene y tratarla como un Datatable por comodidad aquí una pequeña y sencilla Solución con un código simple que espera como parámetro una Lista del tipo genérico.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Tutorial C#&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt; - Convertir Lista Genérica en Datatable&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Código:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; rows=&quot;10&quot;&gt;public DataTable ConvertirListaToDataTable(IList data) {

PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(typeof(T));

DataTable table = new DataTable();

foreach (PropertyDescriptor prop in properties) table.Columns.Add(prop.Name, Nullable.GetUnderlyingType(prop.PropertyType) ?? prop.PropertyType);

foreach (T item in data)
{
DataRow row = table.NewRow();
foreach (PropertyDescriptor prop in properties) row[prop.Name] = prop.GetValue(item) ?? DBNull.Value;
table.Rows.Add(row);
}
return table;
} 
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Con este código solo deberás invocar el método y pasarle una lista del tipo que desees para que se convierta en un Datatble el resultado puedes almacenarlo en una Variable del tipo Datatable o puedes manipularlo desde el método, como por ejemplo en un foreach para recorrerla:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;textarea rows=&quot;3&quot; cols=&quot;80&quot; readonly&gt;
foreach (DataRow row in ConvertirListaToDataTable(MILISTA).Rows
&lt;/textarea&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Espero te haya sido de utilidad.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7531367333045848638/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/11/convertir-lista-en-datatable-c-sharp.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7531367333045848638'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7531367333045848638'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/11/convertir-lista-en-datatable-c-sharp.html' title='Convertir Lista en Datatable C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7159529356011008456</id><published>2012-09-04T08:57:00.000-07:00</published><updated>2014-09-26T11:34:19.966-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><category scheme="http://www.blogger.com/atom/ns#" term="validar email c#"/><title type='text'>Validar Correo Electronico C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Un Correo Electrónico es una cadena de caracteres compuesta de una cierta estructura que ya esta definida y que es posible validar mediante programación, habrá ocasiones en las que necesitemos validar que un correo electrónico se encuentre escrito en el formato correcto, el siguiente método se encargara de recibir una cadena de texto y verificar que posee un formato correcto si es así regresara como resultado un true aceptando que la cadena introducida esta escrita correctamente y en caso contrario regresara un false indicando que la cadena no posee el formato correcto, el código puede ser aplicado tanto en ASP.NET como en Windows Form, el código es el siguiente:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;strong style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #e69138; font-family: Courier New, Courier, monospace;&quot;&gt;Tutorial C#&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;public static bool validarEmail(string email) {
String expresion;
expresion = &quot;\\w+([-+.&#39;]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*&quot;;
if (Regex.IsMatch(email, expresion)) 
{
  if (Regex.Replace(email, expresion, String.Empty).Length == 0) 
  { return true; }
  else { return false; }
}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;El siguiente es un ejemplo de verificar el resultado obtenido por este método y aplicarlo en una validación:&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;if (validarEmail(Email) == false) 
{
  MessageBox.Show(&quot;El Email Ingresado no se encuentra en el Formato Correcto&quot;, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation,                     MessageBoxDefaultButton.Button1);
return false; 

}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Con el siguiente método podrán realizar la validación correspondiente, espero les haya sido de utilidad.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
 &lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7159529356011008456/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/09/Validar-Correo-Electronico-C-Sharp.html#comment-form' title='10 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7159529356011008456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7159529356011008456'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/09/Validar-Correo-Electronico-C-Sharp.html' title='Validar Correo Electronico C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1663054082453728440</id><published>2012-07-16T12:14:00.000-07:00</published><updated>2014-09-24T13:15:20.511-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Datagridview Desde Codigo"/><category scheme="http://www.blogger.com/atom/ns#" term="Modificar Datagridview"/><category scheme="http://www.blogger.com/atom/ns#" term="Ocultar Columna Datagridview C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Modificar Columnas DataGridview desde Codigo</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Un &lt;b&gt;Datagridview&lt;/b&gt; es una forma muy común de mostrar información a los usuarios de una aplicación, ademas de ser una de las mas utilizadas en cualquier aplicación que maneja datos dinámicos, y sin lugar a dudas cuando estamos hablando de aplicaciones que se enlazan a bases de datos.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Tutorial C# :&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Existen varias formas de llenar un &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;DataGridview&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt; con los datos que queremos mostrarle, podemos agregarlos desde código, estéticamente, enlazarlo con una BD mediante el Wizard de Visual Studio, desde código utilizando un &lt;b&gt;Dataset&lt;/b&gt; o un &lt;b&gt;Datatable&lt;/b&gt;, mediante Querys en SQL, en fin, pero que pasa cuando necesitamos modificar algo del diseño del DataGridview desde código, ya sea su apariencia, el color de una celda, fila, o columna o esconder alguna, bueno aquí un sencillo ejemplo de como puedes hacerlo.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;
Modificando las columnas de Datagridview desde código:&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;//Modificar Ancho de una Columna en especifico.
this.MiDataGridview[&quot;COLUMNA&quot;].Width = 200; 

//Ocultar una columna de un DataGridview
this.MiDataGridView.Columns[&quot;COLUMNA&quot;].Visible = false;
&lt;/textarea&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Espero te haya sido de utilidad, saludos.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1663054082453728440/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/07/modificar-columnas-datagridview-desde.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1663054082453728440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1663054082453728440'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/07/modificar-columnas-datagridview-desde.html' title='Modificar Columnas DataGridview desde Codigo'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-451175087793173139</id><published>2012-07-11T09:49:00.003-07:00</published><updated>2014-09-26T11:36:25.120-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Form"/><category scheme="http://www.blogger.com/atom/ns#" term="MDI Parent"/><category scheme="http://www.blogger.com/atom/ns#" term="No repetir MDI Parent"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Como evitar repetir una Forma en un Contenedor Principal MDI</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Cuando desarrollamos aplicaciones mas complejas, que llevan mas de unas cuantas formas es importante designar un contenedor principal para todas las demás formas que se abrirán dentro del menú principal, cuando hayamos dominado esta técnica tendremos algunas otras dudas, por ejemplo como manejar el no abrir mas de una misma forma en un contenedor principal siempre y cuando sea esto necesario, dependiendo de la naturaleza de tu aplicación y de tus formas, habrá ocasiones en las que sea necesario hacerlo y en algunas otras no para cuando este sea el caso podemos utilizar la siguiente validación que nos permitirá saber si una forma ya se encuentra abierta y posicionarnos en ella de ser necesario.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Tutorial C# :&lt;/span&gt; &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;MDI Parent&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;El &lt;b&gt;MDI Parent &lt;/b&gt;o contenedor principal, es una forma en Windows que contendrá todas aquellas otras formas de tu aplicación, es el equivalente a una &lt;b&gt;MasterPage&lt;/b&gt; en &lt;b&gt;ASP.NET&lt;/b&gt; solo que en un ambiente de escritorio, para definir una forma padre basta con localizar las propiedades de la forma e indicar MDIParent en true, una vez hecho esto se le asignara un área que sera la encargada de albergar a las otras formas que se llamen mediante esta.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;Validando que un Form ya se encuentra abierto&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Para hacer esto basta con agregar el siguiente código c# en donde llamemos a la forma que por lo regular sera en alguna parte del toolstrip menú:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Primero declaramos fuera una variable &lt;b&gt;Form&lt;/b&gt; general y le llamaremos Forma:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Lo que sigue después es asignar a esa variable la forma que abriremos y una vez asignada ver si ya se encuentra abierta:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;if (!this.MdiChildren.Contains(Forma))
{
  Forma = new miForma();
  Forma.MdiParent = this;
  Forma.Show();
}
else
{
  MessageBox.Show(&quot;Actualmente tiene una forma activa.&quot;, &quot;Mensaje de Advertencia&quot;,  MessageBoxButtons.OK, MessageBoxIcon.Information);
  Forma.Focus();
}
&lt;/textarea&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Una vez hecho esto validaremos que una forma no se encuentre abierta, en este ejemplo mostramos un mensaje pero solo es indicativo tu decides si mostrarlo o solo hacer el Focus a la forma.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/451175087793173139/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/07/como-evitar-repetir-una-forma-en-un.html#comment-form' title='5 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/451175087793173139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/451175087793173139'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/07/como-evitar-repetir-una-forma-en-un.html' title='Como evitar repetir una Forma en un Contenedor Principal MDI'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-4018488284407723133</id><published>2012-06-19T12:43:00.000-07:00</published><updated>2014-09-24T16:37:31.170-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Llenar dropdownlist c#"/><category scheme="http://www.blogger.com/atom/ns#" term="llenar dropdownlist con datos"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Llenar un DropdownList con Datos ASP.NET C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;En Asp.net llenar un Dropdownlist es un poco distinto a cuando llenamos un Combobox en una aplicación de Windows Form, aunque son muy similares un Combobox tiene distintas funciones y por lo tanto diferentes propiedades, que cambian en un control DropdownList de ASP.NET y es necesario identificar cuales son y cual es la forma correcta de llenar un DropdownList, en este ejemplo lo haremos utilizando no datos estáticos sino que aprenderemos como hacerlos con datos de una consulta en SQL, lo demás a continuación.&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;Tutorial C#&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;En el siguiente ejemplo utilizare una consulta ficticia pero fácilmente entendible que podrá ser sustituida por la que necesites sin mayores problemas, el código estará dentro de un Método para que se entienda mejor, veamos el código:
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;public void cargarZonas()
{
   SqlCommand OrdenSqlSelect = new SqlCommand(&quot;SELECT * FROM Zonas&quot;, ConexionBd);
   SqlDataAdapter da = new SqlDataAdapter(OrdenSqlSelect.CommandText, ConexionBd);
   DataSet ds = new DataSet();
   da.Fill(ds);
   this.ddZona.DataSource = ds;
   this.ddZona.DataValueField = &quot;CodZona&quot;;
   this.ddZona.DataTextField = &quot;Zona&quot;;
   this.ddZona.DataBind();
   this.ddZona.Items.Insert(0, new ListItem(&quot;Elija una Opcion..&quot;, &quot;0&quot;));       
}
&lt;/textarea&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;El código es muy simple de entender indicamos la Consulta con un string, y ademas le indicamos la cadena de Conexión con otro string, creamos un SqlDataAdapter y le enviamos como parámetros la cadena de texto de la consulta y la conexión, lo siguiente es crear un Dataset que también puede ser un Datatable depende de como lo quieras utilizar, el método Fill del DataAdapter llena nuestro Dataset y por ultimo solo es cuestión de asignarle los valores a nuestro Dropdownlist los cuales son:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;- DataSource&lt;/b&gt; , la fuente de datos.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;- DataValueField&lt;/b&gt; , el valor que tendrá ese campo en especifico es invisible para el usuario final.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;- DataTextField&lt;/b&gt; , el valor que se mostrara al Usuario final.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;- DataBind()&lt;/b&gt;, este método enlaza los datos a nuestro dropdownlist si no lo indicamos no se nos reflejara nada.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;-&lt;/b&gt; Lo ultimo solo es un plus y puedes agregarlo o no y sirve para agregar un Item para que no este precargado ningún dato y especifiques al usuario que debe seleccionar alguno primero.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;El Código es muy fácil de entender, espero te sea de utilidad, saludos.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/4018488284407723133/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/llenar-un-dropdownlist-con-datos-aspnet.html#comment-form' title='22 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/4018488284407723133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/4018488284407723133'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/llenar-un-dropdownlist-con-datos-aspnet.html' title='Llenar un DropdownList con Datos ASP.NET C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>22</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1817034987646532581</id><published>2012-06-17T18:29:00.000-07:00</published><updated>2014-09-26T11:39:13.961-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog en Español"/><category scheme="http://www.blogger.com/atom/ns#" term="C# y SQL"/><category scheme="http://www.blogger.com/atom/ns#" term="Conexion a Base de Datos"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Crear un Sistema con conexión a BD paso a paso C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Primero que nada esta estoy en un proceso de re-estructuración&amp;nbsp;del Blog, anteriormente los&amp;nbsp;artículos&amp;nbsp;eran vagos con poca&amp;nbsp;información&amp;nbsp;y poco&amp;nbsp;explícitos&amp;nbsp;donde solo publicaba los enlaces de descarga de los proyectos, para cambiar esto ahora empezare a publicar soluciones completas, mejor estructurado el contenido de mis&amp;nbsp;artículos&amp;nbsp;y aunque no prometo hacerlo muy seguido debido a que pocas veces tengo tiempo, prometo que los contenidos&amp;nbsp;serán&amp;nbsp;de mayor calidad y mas&amp;nbsp;útiles.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Para demostrar esto primero que nada publicare una de las mayores herramientas que un programador novato y con un poco de experiencia pueden tener, la&amp;nbsp;conexión&amp;nbsp;con una BD, en este caso SQL Server que es la que mejor se integra con Visual Studio y la Plataforma .NET, empecemos.&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;Tutorial C#&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;El siguiente tutorial les enseñara como paso a paso podrán conectarse a una BD en SQL Server y hacer las 4 consultas basicas: SELECT, INSERT, UPDATE y DELETE.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Empecemos.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Primero que nada abriremos nuestro Visual Studio o Visual C# Express, crearemos un nuevo proyecto del tipo windows form:&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Ahora nos dirigiremos a el proyecto nuevamente y damos clic derecho en propiedades, nos dirigimos a settings y creamos un tipo de dato string llamado cadenaConexion con la cadena de conexión:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;outline: none 0px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjOBMbXrLqgbIhZh2L6DKRLxFHbQkOj7nuI4tVtOQHflEnNrBF8GYx2AzSyDHxV2f_4hRveMVJzcaWQ23BzGrO-ES65XgOEawBjvWbq5uGmmWnXidALiIuyQ9wbVs3w4c4O1lnpnxYxOOx/s1600/1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjOBMbXrLqgbIhZh2L6DKRLxFHbQkOj7nuI4tVtOQHflEnNrBF8GYx2AzSyDHxV2f_4hRveMVJzcaWQ23BzGrO-ES65XgOEawBjvWbq5uGmmWnXidALiIuyQ9wbVs3w4c4O1lnpnxYxOOx/s640/1.jpg&quot; height=&quot;325&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Crearemos una interfaz que contenga 3 Textbox y un Boton para la Insercion, un textbox con un boton para la eliminacion y 3 textbox y un boton para la actualizacion, algo similar a esto:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLKVly4_zsMwX97lh8OXIxmU9Jx53_yfAA73crdcj3KkEqhmzx0E-H8dWOcjnb3WjGM-UswE4Kk7nbJmdYCabhuWXe95apyCI-_Inzu0fc959NE-xXCbIxgwH6h5gJL0rpXD9GpAMQVCPv/s1600/2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLKVly4_zsMwX97lh8OXIxmU9Jx53_yfAA73crdcj3KkEqhmzx0E-H8dWOcjnb3WjGM-UswE4Kk7nbJmdYCabhuWXe95apyCI-_Inzu0fc959NE-xXCbIxgwH6h5gJL0rpXD9GpAMQVCPv/s640/2.jpg&quot; height=&quot;440&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px; text-align: -webkit-auto;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Damos clic derecho en el proyecto y agregamos un nuevo elemento, elegimos el tipo de archivo de configuración:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-PV0SJwsyg5AFzT_Uyd4uEdh1VJbuBhvERoXwIgOrXzgU8vtRiLLYKb9TzBH1LvgtCu9BQyVuZhJsvmv3fEg76uBz_ZF2hoKS2MlEEgQb_ZYSf1iBWiMTKSdTBD0pJWwLHOeve1tBndhO/s1600/3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-PV0SJwsyg5AFzT_Uyd4uEdh1VJbuBhvERoXwIgOrXzgU8vtRiLLYKb9TzBH1LvgtCu9BQyVuZhJsvmv3fEg76uBz_ZF2hoKS2MlEEgQb_ZYSf1iBWiMTKSdTBD0pJWwLHOeve1tBndhO/s640/3.jpg&quot; height=&quot;442&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDreHGqOF-3o_myG1zRxCFbsvCzrzwv7TW9eHZTbu8ZDm_ckkJlAIngD2bxcZ1cJbJUgCj2Zr7JJytNgcytF8K-TdaFuROvdmjfi2Jf7xarn5bO0C1SvFrTOJ-5QQ3ue8quocmlEqZxouy/s1600/4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDreHGqOF-3o_myG1zRxCFbsvCzrzwv7TW9eHZTbu8ZDm_ckkJlAIngD2bxcZ1cJbJUgCj2Zr7JJytNgcytF8K-TdaFuROvdmjfi2Jf7xarn5bO0C1SvFrTOJ-5QQ3ue8quocmlEqZxouy/s640/4.jpg&quot; height=&quot;294&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Observaremos que nuestro archivo de configuracion a cambiado y ya tendra la cadena de Conexion:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM36QNvPvMvJw7Uw2VlixpeK5A2IlAskNtb_Ed1Wx2mKzjPTAL5xXKQWhyphenhyphenJOi9mtf8xnV5huRzl5zcXe9R57EDN1tGR155h8lfCOd-kz9CRBiCzqb8WgKwUq3Nj2x6ZND-A-3YT7DexD0O/s1600/5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM36QNvPvMvJw7Uw2VlixpeK5A2IlAskNtb_Ed1Wx2mKzjPTAL5xXKQWhyphenhyphenJOi9mtf8xnV5huRzl5zcXe9R57EDN1tGR155h8lfCOd-kz9CRBiCzqb8WgKwUq3Nj2x6ZND-A-3YT7DexD0O/s640/5.jpg&quot; height=&quot;176&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Ahora nos pasaremos al codigo de la aplicacion donde deberemos importar las librerias para manejar SQL, creamos una variable de tipo SQLConection de nombre Conexion, y dentro del constructor indicamos de donde obtendremos la cadena de conexion:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5UgpdpQCcunI9PbwpavB28TNfD5uAk1MQaKZOy_JZSuQaD0Ygvbb4LGWB0Gs5kPSehFEDIKNeiQMjoC0aD71mAtaOvb4T__Q5sk3YIzuHME3fFxX9b83wKfARNh__w8jz5xDCry8emy-d/s1600/6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5UgpdpQCcunI9PbwpavB28TNfD5uAk1MQaKZOy_JZSuQaD0Ygvbb4LGWB0Gs5kPSehFEDIKNeiQMjoC0aD71mAtaOvb4T__Q5sk3YIzuHME3fFxX9b83wKfARNh__w8jz5xDCry8emy-d/s1600/6.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Despues crearemos una pequeña base de datos que contenga una tabla que resiva los 3 datos nombre, apellido, edad y le llamaremos Persona:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_gPNjmf6cxG9I8uU32V-ARdDO6w5fFSxdhBjUxWYwGDozw1OJQEsN-DV5iHgIHT1E6PVDgGWBVUe1HlnBMaoQZnvE3-pLjJu5k3ECDKAlq0dqWZ6fHkXb1Jr641puTtfHlThyNbpYRlT/s1600/7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgP_gPNjmf6cxG9I8uU32V-ARdDO6w5fFSxdhBjUxWYwGDozw1OJQEsN-DV5iHgIHT1E6PVDgGWBVUe1HlnBMaoQZnvE3-pLjJu5k3ECDKAlq0dqWZ6fHkXb1Jr641puTtfHlThyNbpYRlT/s1600/7.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Como primera consulta usaremos un select que consulte la informacion de nuestra BD y llene el DataGridView con esta consulta:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnET9mTMoUZTji6Dh94-JFB0_BibE6l_XDCTlvA_JGMg8RuJyX8es7LBSX1AvYRrph-4tVrf9IhjbzBAPDaYDP_kOOXFH4wbeHDkezVvKeEZnG9XnJINsoI9wzdFLAH3tMvo8-gbVhyKNU/s1600/8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnET9mTMoUZTji6Dh94-JFB0_BibE6l_XDCTlvA_JGMg8RuJyX8es7LBSX1AvYRrph-4tVrf9IhjbzBAPDaYDP_kOOXFH4wbeHDkezVvKeEZnG9XnJINsoI9wzdFLAH3tMvo8-gbVhyKNU/s1600/8.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFKsE7krHMbTmbBP8TNS8mzUA3Q2E9_efoAIA4koxMX0AfSF-dwoHU0_NoL-4XFV9S8bEsj3kc8l74WF1LIpYr4VIdKdEG-zANv5bnh9XLYjldw_NB5HRBqi2UoFqMvZjMh_psPwLlLCp/s1600/9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNFKsE7krHMbTmbBP8TNS8mzUA3Q2E9_efoAIA4koxMX0AfSF-dwoHU0_NoL-4XFV9S8bEsj3kc8l74WF1LIpYr4VIdKdEG-zANv5bnh9XLYjldw_NB5HRBqi2UoFqMvZjMh_psPwLlLCp/s640/9.jpg&quot; height=&quot;440&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Como segunda Query en el evento clic de la insercion agregaremos el codigo para hacer la insercion:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcW_HwMfH7u7P07KuTGQ2v48hgx9ZZQIOG7mVSCqpm9mfEh8D81T5aNG3lvLlr6KkxWApODjWBEmv2OI-2yyPMpabYTN6qQO7Ra-Q-KHoNGo6g9mrPaNu9fSDyqoi1bBGEDKSkc9mq8kGO/s1600/10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcW_HwMfH7u7P07KuTGQ2v48hgx9ZZQIOG7mVSCqpm9mfEh8D81T5aNG3lvLlr6KkxWApODjWBEmv2OI-2yyPMpabYTN6qQO7Ra-Q-KHoNGo6g9mrPaNu9fSDyqoi1bBGEDKSkc9mq8kGO/s640/10.jpg&quot; height=&quot;143&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Como tercera Query en el evento clic del borrado agregamos el codigo para eliminar:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Zvn99OWW7k9a9ImpyytFekmCFmaxUZTfulG9lrxzZyPPVNaMV149IZmNj-FL7fVTe2K9ZeimHQYeJGx1UNPaWmc3ij3uytE2cKJleD0DPpSj1jxvZhwRuw-u9grX1PQtLeZ7JMciFteX/s1600/11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg3Zvn99OWW7k9a9ImpyytFekmCFmaxUZTfulG9lrxzZyPPVNaMV149IZmNj-FL7fVTe2K9ZeimHQYeJGx1UNPaWmc3ij3uytE2cKJleD0DPpSj1jxvZhwRuw-u9grX1PQtLeZ7JMciFteX/s640/11.jpg&quot; height=&quot;131&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Por ultimo en el evento clic en la parte de actualizacion agregamos el codigo para actualizacion:&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzEVw0W43_XZJ1G3ehkzcMOWGrBo5NLhYSkIcH0nwX_1MLx36VvGq6rswTA0rqjrh0HsveoRH8BXJs_zMQf965V4fioLyvvlgj-lrX85bPlvEZGqp4wPZJTcLLVLwVbQ_HiW8PTUKRCWHD/s1600/12.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzEVw0W43_XZJ1G3ehkzcMOWGrBo5NLhYSkIcH0nwX_1MLx36VvGq6rswTA0rqjrh0HsveoRH8BXJs_zMQf965V4fioLyvvlgj-lrX85bPlvEZGqp4wPZJTcLLVLwVbQ_HiW8PTUKRCWHD/s640/12.jpg&quot; height=&quot;143&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Le damos los ultimos detalles a el diseño de la aplicacion, la ejecutamos y la probamos y tendremos algo similar a esto:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLbWHUdtGpt3KpFtryRL6w7UxsLm-sEraA9YkQys7mAZkuqlYpGb5Bk9Gp8e4CknVsO47k5A9WJSSfiGdfyah1gHJJozeQommkiYTmIM2mX9N4-U9GorA5z2pWoBEPCXhjgpAQ_dMeYOel/s1600/13.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLbWHUdtGpt3KpFtryRL6w7UxsLm-sEraA9YkQys7mAZkuqlYpGb5Bk9Gp8e4CknVsO47k5A9WJSSfiGdfyah1gHJJozeQommkiYTmIM2mX9N4-U9GorA5z2pWoBEPCXhjgpAQ_dMeYOel/s640/13.jpg&quot; height=&quot;441&quot; width=&quot;640&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Con este principio basico podran avanzar hacia programas mas complejos, empezar a validar datos entrantes, y muchas otras mas cosas, espero les haya servido y hayan aprendido como se hace.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; line-height: 19px;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;background-color: white; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Saludos y espero&amp;nbsp;continúen&amp;nbsp;visitando nuevamente mi blog, comenten y digan que les parece el &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;line-height: 19px;&quot;&gt;nuevo diseño del Blog.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1817034987646532581/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/crear-un-sistema-con-conexion-bd-paso.html#comment-form' title='28 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1817034987646532581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1817034987646532581'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/crear-un-sistema-con-conexion-bd-paso.html' title='Crear un Sistema con conexión a BD paso a paso C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjOBMbXrLqgbIhZh2L6DKRLxFHbQkOj7nuI4tVtOQHflEnNrBF8GYx2AzSyDHxV2f_4hRveMVJzcaWQ23BzGrO-ES65XgOEawBjvWbq5uGmmWnXidALiIuyQ9wbVs3w4c4O1lnpnxYxOOx/s72-c/1.jpg" height="72" width="72"/><thr:total>28</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-4161834382692513235</id><published>2012-06-15T15:19:00.002-07:00</published><updated>2014-09-24T16:17:38.543-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Ejercicios"/><category scheme="http://www.blogger.com/atom/ns#" term="Keypress"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion con C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Solo Numeros C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Solo numeros Keypress</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El siguiente código tan solo te sera útil en aplicaciones que contengan el evento Keypress, tales como aplicaciones que usen Windows Forms o Windows Mobile, si piensas utilizarlo en ASP.NET me temo que tendrás que buscar otras alternativas como usar Javascript, el funcionamiento es muy sencillo solo es agregar el evento Keypress evitando que podamos ingresar caracteres que no sean del tipo numérico, el código es el siguiente:&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;Tutorial C#&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;private void soloNumeros_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar))
{
e.Handled = false;
}
else if (char.IsControl(e.KeyChar))
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Por ultimo solo es cuestión de agregar el evento keypress al control donde lo queramos y podamos utilizar, saludos.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/4161834382692513235/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/el-siguiente-codigo-tan-solo-te-sera.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/4161834382692513235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/4161834382692513235'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/el-siguiente-codigo-tan-solo-te-sera.html' title='Solo numeros Keypress'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-675198603827523445</id><published>2012-06-15T11:52:00.000-07:00</published><updated>2014-09-24T16:21:51.619-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Leer CSV C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Leer un archivo CSV con C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Muchas veces cuando programamos una aplicación es necesario interactuar con otros archivos o crearlos, uno de los archivos estándar mas utilizados para crear archivos en base a una base de datos o sobre todo tipo de archivos es el XML por ser el estándar, sin embargo existen otras alternativas mas específicamente cuando queremos manejar archivos creados desde una BD en Excel que es uno de los software que mas empresas manejan para uso de documentos que involucren datos o cantidades, por ser el estándar en el mercado de Software de este tipo, es verdad que el XML es mas complejo tiene una mejor y mas solida estructura pero puede darse el caso que necesitemos algo mas.&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Los CSV (Comma Separated Value) son como su nombre lo dice archivos de texto cuya separación se especifica con una coma, si quieres investigar un poco mas sobre su estructura puedes buscar un poco mas de ellos en Google, pero ahora veamos como leer un archivo de este tipo.&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;h2&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Tutorial C#&lt;/span&gt;&lt;/h2&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Esta necesidad surgió hacia mi debido a que en un proyecto tuve que utilizarlos debido a que debía encargarse de manejar una gran cantidad de datos que en un XML seria un tamaño enorme y el dispositivo móvil tenia muchas limitaciones en cuanto a memoria, una vez dicho esto pasemos al código:&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;public List&lt;string[]&gt; parseCSV(string path)
{
List&lt;string[]&gt; parsedData = new List&lt;string[]&gt;();

using (StreamReader readFile = new StreamReader(path))
{
string line;
string[] row;

while ((line = readFile.ReadLine()) != null)
{
row = line.Split(&#39;,&#39;);
parsedData.Add(row);
}
}
return parsedData;
}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Primero que nada necesitamos el método que se encargara de leer el archivo, de texto y darle su respectiva estructura, en este caso al leer el archivo lo almacenaremos en un Datatable para poder posteriormente cargar un Grid o hacer cualquier cosa que necesitemos.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Este código lo encontré en varios sitios de Internet y era el mismo en todos los sitios donde lo busque, incluso es el mismo patrocinado por Microsoft para manejar estos archivos, pero yo tuve un pequeño problema con lo que seguía para utilizarlo el y aquí va mi modificación para resolverlo. Yo necesitaba cargar un Gridview y que la primera fila me la reconociera como el Nombre de cada una de las columnas sin embargo esto por si solo no lo hacia así que aplique un pequeño truco, como yo sabia que Nombre tendría mi primera columna agregue al código ese nombre para que tomara eso como una indicación de que esa fila contenía el nombre de las columnas así fue como quedo al final:&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;try
{
dt.Clear();
List&lt;string[]&gt; testParse =
  parseCSV(AppPath + &quot;\\&quot; + &quot;ARCHIVO.csv&quot;);


foreach (string column in testParse[0])
{
dt.Columns.Add(column);
}

foreach (string[] row in testParse)
{
  if (row.Contains(&quot;NOMBREDEPRIMERACOLUMNA&quot;)) { }
else { dt.Rows.Add(row); }
}
}
catch 
{ 
  MessageBox.Show(&quot;No existe ningún archivo CSV con ese nombre.&quot;);
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &amp;quot;Courier New&amp;quot;, &amp;quot;Courier&amp;quot;, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Una vez ejecutada esta instrucción nuestro DataTable habrá sido llenado con lo que este dentro del CSV, aunque debe tener una estructura del tipo tabla, mismo numero de columnas en todas las filas sobre todo, espero les haya sido de utilidad, saludos.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Quizás también te Interese:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;span style=&quot;font-family: &amp;quot;Arial&amp;quot;, &amp;quot;Helvetica&amp;quot;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/675198603827523445/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/leer-un-archivo-csv-con-c.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/675198603827523445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/675198603827523445'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/leer-un-archivo-csv-con-c.html' title='Leer un archivo CSV con C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1327213638432056255</id><published>2012-06-15T10:32:00.002-07:00</published><updated>2014-09-24T16:27:45.076-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Añadir Parametros SQL C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Blog C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="SQLCommand C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Agregar Parametros a un SQLCommand</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Tenemos varias formas de realizar una instrucción SQL una de las mas usadas sin duda es el utilizar un &lt;b&gt;SQLCommand&lt;/b&gt; que contiene la instrucción SQL en forma de cadena de texto o string, y la cadena de conexión, con un &lt;i&gt;SQLCommand&lt;/i&gt; nosotros podemos hacer varias cosas como ejecutar una consulta, realizar un Insert, un Update, un Delete, llenar un Datatable por solo mencionar algunos.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Ahora tenemos varias formas de enviarle una cadena a un SQL Command:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Una de las mas utilizadas cuando estamos aprendiendo es el concatenar un string con otros string provenientes ya sea de un Textbox, o conversiones por ejemplo:&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;SqlCommand sql  =  new SqlCommand(&quot;SELECT * FROM&quot; + string  + &quot;WHERE Nombre = &quot; + string , miConexion);
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Esta forma parece ser sencilla pero te brinda menor flexibilidad, menor forma de detectar errores en una Consulta entre otras cosas como que es mas difícil, así que lo mejor que podemos hacer es &lt;b&gt;añadir parámetros a una consulta&lt;/b&gt;, utilicemos el mismo ejemplo:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;SqlCommand sql = new SqlCommand(&quot;SELECT * FROM Persona WHERE Nombre = @Nombre&quot;, miConexion);
sql.Parameters.Add(&quot;Nombre&quot;, SqlDbType.Varchar).Value = UNSTRING;
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Eso para añadir los parámetros que necesitemos, recuerda el parámetro va precedido por un signo @ y el nombre del Parámetro en la cadena de conexión y debemos indicar el mismo nombre cuando queremos darle un valor a ese parámetro, de esta forma tendrás un mejor uso en tus instrucciones SQL y cuando tengas un error el compilador te dará mejores detalles sobre cual es.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1327213638432056255/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/agregar-parametros-un-sqlcommand.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1327213638432056255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1327213638432056255'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/agregar-parametros-un-sqlcommand.html' title='Agregar Parametros a un SQLCommand'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7515724385100210815</id><published>2012-06-05T12:54:00.000-07:00</published><updated>2014-09-24T16:29:57.901-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Cargar Imagen PictureBox c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Pocket PC"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Windows Mobile C#"/><title type='text'>Cargar Imagen PictureBox Windows Mobile C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Que tal Amigos, si nunca han programado en &lt;b&gt;Windows Mobile&lt;/b&gt;, notaran al hacerlo que los mismos controles para &lt;b&gt;Windows Form&lt;/b&gt; tienen distintas propiedades y eventos, por no decir que solo tendrán menos, por lo tanto el cargar una imagen a un &lt;i&gt;PictureBox&lt;/i&gt; especificando la ruta no sera del todo igual que en Windows, asi que para hacerlo si es que alguna vez tienes este problema como yo hace unos momentos te dejo el siguiente &lt;b&gt;código c#&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;


&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;TUTORIAL C#:&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;//Aquí obtendremos la Ruta de nuestra aplicación.
public static string AppPath
{
get
{
return Path.GetDirectoryName(
System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName); ;
}
}
//En este metodo solo cargamos la imagen indicando la ruta y el nombre de la imagen.
private void frmMapa_Load(object sender, EventArgs e)
{
  pbMapa.Image = new System.Drawing.Bitmap(AppPath + &quot;\\&quot; +&quot;Mapa.png&quot;);
pbMapa.SizeMode = PictureBoxSizeMode.Normal;
}
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Su funcion es muy sencilla, obtiene el &lt;i&gt;Path de tu Aplicación&lt;/i&gt; y lo guarda en una variable, que pasaras junto con el nombre del archivo al PictureBox en su punto Imagen, con esto podrás resolver ese problema, saludos.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7515724385100210815/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/cargar-imagen-picturebox-windows-mobile.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7515724385100210815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7515724385100210815'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/cargar-imagen-picturebox-windows-mobile.html' title='Cargar Imagen PictureBox Windows Mobile C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7070833797948126582</id><published>2012-05-29T14:36:00.001-07:00</published><updated>2014-09-24T16:32:34.741-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Aprender C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Eliminar Comillas Dobles C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Tip: Eliminar comillas Dobles C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;En algunas ocasiones cuando practiques la&amp;nbsp;&lt;b&gt;programación&amp;nbsp;en c#&lt;/b&gt; tendrás que eliminar algún carácter de una cadena de texto, por ejemplo cuando trabajas con archivos CSV que podrían contener comillas para encerrar algún texto, esto lo puedes realizar con esta forma sencilla que no necesita mayor explicación ni problema:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;Tutorial C#:&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;2&quot;&gt;micadenadetexto.ToString().Replace(&#39;&quot;&#39;, &#39; &#39;).Trim();
&lt;/textarea&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Con este método podrás eliminar las comillas dobles, o puedes eliminar algún otro carácter sustituyendo las comillas por este, espero les sea de utilidad que yo batalle hace algún tiempo para buscar información sobre como eliminar las comillas dobles, saludos.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7070833797948126582/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/tip-eliminar-comillas-dobles-c.html#comment-form' title='3 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7070833797948126582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7070833797948126582'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/tip-eliminar-comillas-dobles-c.html' title='Tip: Eliminar comillas Dobles C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7050181279248864285</id><published>2012-05-28T11:43:00.000-07:00</published><updated>2012-07-20T12:32:17.824-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Encriptacion 2 Vias C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Encriptar C Sharp"/><category scheme="http://www.blogger.com/atom/ns#" term="Encriptar C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Encriptar MD5 C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Encriptar Windows Form"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Encriptar con MD5 C#</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxfhBEzE7DURoDpnPrAIi2cMJZ-2y4dP9nbMgC9ujySD13OaH37T9vyW5NdRIbr7Yyfy799LDrGYK5MVnEuLX6t6gKUxQ5xh-4y75UYnEXbNB9h1bTQGjyE2vh7iU4a2jBZ3vzKnLIUGpz/s1600/Encriptar.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxfhBEzE7DURoDpnPrAIi2cMJZ-2y4dP9nbMgC9ujySD13OaH37T9vyW5NdRIbr7Yyfy799LDrGYK5MVnEuLX6t6gKUxQ5xh-4y75UYnEXbNB9h1bTQGjyE2vh7iU4a2jBZ3vzKnLIUGpz/s320/Encriptar.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Uno de los mayores inconvenientes a la hora de realizar una &lt;b&gt;aplicación en c# &lt;/b&gt;que maneje usuarios y &lt;b&gt;bases de datos&lt;/b&gt;, &amp;nbsp;es la seguridad de la contraseña del usuario, esto no solo en aplicaciones web sino también en aplicaciones de escritorio o moviles puede ser un problema al que te habrás enfrentado, por lo tanto te presento una alternativa sencilla para que puedas encriptar las contraseñas de tus usuarios en una Base de datos y que no cualquiera que tenga permiso de entrar a esta pueda ver las contraseñas de los usuarios en esta misma.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;H2&gt;TUTORIAL C#&lt;/H2&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;Empezando el Proyecto&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Primero que nada necesitamos realizar un proyecto del tipo &lt;b&gt;Windows Form&lt;/b&gt;, o Web Form en este caso sera un Windows Form que me parece mas sencillo para este tipo de ejemplos, aunque el mismo código puede ser adaptado a un Web Form, crearemos un Form con los elementos que se ven en la imagen, una vez hecho esto solo nos queda entrar al código, aunque tratare de dar una breve explicación de como funciona este antes de verlo.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Como Funciona&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Este código es sumamente sencillo, utiliza una &lt;b&gt;librería de .Net&lt;/b&gt; la cual es:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;System.Security.Cryptography;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;La cual es la que realizara el trabajo pesado por nosotros, otra de las cosas que necesitamos es especificar una llave o &quot;key&quot; la cual nos servirá para encriptar y también para desencriptar, la cual podemos incluir en el código como en este ejemplo o manejarla como mejor nos parezca, y tendremos 2 métodos uno para encriptar y otro para revertir o desencriptar, una vez entendido esto veamos el codigo.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;Codificando&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Trebuchet MS&#39;, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Primero que nada crearemos una variable del tipo string que contendra la llave:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;string&lt;/span&gt; key = &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;mikey&quot;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Después creamos los métodos tanto para encriptar como para desencriptar:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;public string&lt;/span&gt; Encriptar(&lt;span style=&quot;color: #0b5394;&quot;&gt;string&lt;/span&gt; texto)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #38761d;&quot;&gt;//arreglo de bytes donde guardaremos la llave&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] keyArray;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//arreglo de bytes donde guardaremos el texto&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //que vamos a encriptar&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] Arreglo_a_Cifrar =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            UTF8Encoding.UTF8.GetBytes(texto);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//se utilizan las clases de encriptación&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //provistas por el Framework&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //Algoritmo MD5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            MD5CryptoServiceProvider hashmd5 =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            new MD5CryptoServiceProvider();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//se guarda la llave para que se le realice&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //hashing&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            keyArray = hashmd5.ComputeHash(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            UTF8Encoding.UTF8.GetBytes(key));&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            hashmd5.Clear();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #38761d;&quot;&gt;//Algoritmo 3DAS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            TripleDESCryptoServiceProvider tdes =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            new TripleDESCryptoServiceProvider();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Key = keyArray;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Mode = CipherMode.ECB;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Padding = PaddingMode.PKCS7;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //se empieza con la transformación de la cadena&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            ICryptoTransform cTransform =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.CreateEncryptor();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//arreglo de bytes donde se guarda la&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //cadena cifrada&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] ArrayResultado =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            cTransform.TransformFinalBlock(Arreglo_a_Cifrar,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            0, Arreglo_a_Cifrar.Length);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Clear();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #38761d;&quot;&gt;//se regresa el resultado en forma de una cadena&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            return Convert.ToBase64String(ArrayResultado,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                   0, ArrayResultado.Length);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;public string&lt;/span&gt; Desencriptar(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; textoEncriptado)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] keyArray;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #38761d;&quot;&gt;//convierte el texto en una secuencia de bytes&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] Array_a_Descifrar =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            Convert.FromBase64String(textoEncriptado);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;//se llama a las clases que tienen los algoritmos&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //de encriptación se le aplica hashing&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            //algoritmo MD5&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            MD5CryptoServiceProvider hashmd5 =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            new MD5CryptoServiceProvider();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            keyArray = hashmd5.ComputeHash(&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            UTF8Encoding.UTF8.GetBytes(key));&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            hashmd5.Clear();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            TripleDESCryptoServiceProvider tdes =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            new TripleDESCryptoServiceProvider();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Key = keyArray;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Mode = CipherMode.ECB;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Padding = PaddingMode.PKCS7;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            ICryptoTransform cTransform =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;             tdes.CreateDecryptor();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            byte[] resultArray =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            cTransform.TransformFinalBlock(Array_a_Descifrar,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            0, Array_a_Descifrar.Length);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            tdes.Clear();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #38761d;&quot;&gt;//se regresa en forma de cadena&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            return UTF8Encoding.UTF8.GetString(resultArray);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Una vez terminado esto solo nos queda ingresar las llamadas a estos métodos desde los botones de la aplicación:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;private void&lt;/span&gt; button1_Click(object sender, EventArgs e)&lt;br /&gt;        {&lt;br /&gt;            textBox2.Text = Encriptar(textBox1.Text);&lt;br /&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;private void&lt;/span&gt; button2_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            textBox3.Text = Desencriptar(textBox2.Text);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;El resultado final seria este:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg3not-y0WP609GzbTy6aOMJRoTsU8clFMsDzl_UszxvjF4tWy_yxA3gzwPqqZfpuAzYezyJj4syZ-sD0QBC8-HeT8HDGKbx3VZE2etpUZuEvRvCRhuvzJehx2-auUFjGB2LV4sxTiNlKa/s1600/Encriptar+MD5.png&quot; imageanchor=&quot;1&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;206&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg3not-y0WP609GzbTy6aOMJRoTsU8clFMsDzl_UszxvjF4tWy_yxA3gzwPqqZfpuAzYezyJj4syZ-sD0QBC8-HeT8HDGKbx3VZE2etpUZuEvRvCRhuvzJehx2-auUFjGB2LV4sxTiNlKa/s320/Encriptar+MD5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;

&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Con esto terminamos este ejemplo, pero recuerden que entre mas sencilla sea la forma de encriptar y desencriptar mas fácil sera para un usuario experimentado averiguar la forma de desencriptar nuestra información, este ejemplo es meramente educativo sin embargo no es el mas seguro, saludos.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7050181279248864285/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/encriptar-con-md5-c.html#comment-form' title='10 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7050181279248864285'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7050181279248864285'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/encriptar-con-md5-c.html' title='Encriptar con MD5 C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxfhBEzE7DURoDpnPrAIi2cMJZ-2y4dP9nbMgC9ujySD13OaH37T9vyW5NdRIbr7Yyfy799LDrGYK5MVnEuLX6t6gKUxQ5xh-4y75UYnEXbNB9h1bTQGjyE2vh7iU4a2jBZ3vzKnLIUGpz/s72-c/Encriptar.png" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-6629201757496059668</id><published>2012-05-19T12:59:00.001-07:00</published><updated>2012-07-10T22:58:53.200-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blog C#"/><category scheme="http://www.blogger.com/atom/ns#" term="ejercicos c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Como mover Form sin Bordes</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpd8otwamHYsF_rxZmwwPX_qs72kcvlF4mA_Rf71h7d7ZC-aIHcOjPVvnLUaL0M0wQO3IjKepGKztMWKw3Hp015kkby4EI_ej9Gyv_5CA-iK5sbWKy67F2dKSzYTmJz3Tshc-9Z0Ogm-oX/s1600/2012-05-19_120700.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpd8otwamHYsF_rxZmwwPX_qs72kcvlF4mA_Rf71h7d7ZC-aIHcOjPVvnLUaL0M0wQO3IjKepGKztMWKw3Hp015kkby4EI_ej9Gyv_5CA-iK5sbWKy67F2dKSzYTmJz3Tshc-9Z0Ogm-oX/s320/2012-05-19_120700.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Muchas veces queremos tener un Form diseñado por nosotros mismos cuando&amp;nbsp;practicamos&amp;nbsp;la&amp;nbsp;&lt;b&gt;programación&amp;nbsp;en c#&lt;/b&gt;, restandole los&amp;nbsp;clásicos&amp;nbsp;controles de Windows o no depender del estilo de nuestro Windows o su&amp;nbsp;versión, para eso podemos &lt;i&gt;quitarle los Bordes a nuestro Form&lt;/i&gt;, pero ya te&amp;nbsp;habrás&amp;nbsp;dado cuenta si lo intentaste, que una vez hecho esto nuestro Form no&amp;nbsp;tendrá&amp;nbsp;la&amp;nbsp;opción&amp;nbsp;de moverse, ni contara con los botones de cerrar, maximizar o minimazar, para eso veremos como hacer una&amp;nbsp;aplicación&amp;nbsp;que no contenga estilos de Windows, lo que necesitamos es lo siguiente:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- Quitarle los Bordes a un Form.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- Agregar ya sea una Imagen de Fondo, o dibujar alguna utilizando algunos Panel.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- Agregar un&amp;nbsp;botón&amp;nbsp;para cerrar el Form.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Como ejemplo puedes tomar el Form que se muestra en este post.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Una vez diseñado nuestro Form, debemos incluir en nuestro código lo siguiente:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;Importar las Dll&lt;/b&gt; de user32 de Windows que contiene los métodos para mover ventanas, las cuales podemos agregar con el siguiente código:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[&lt;span style=&quot;color: #3d85c6;&quot;&gt;DllImport&lt;/span&gt;(&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;user32.DLL&quot;&lt;/span&gt;, EntryPoint = &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;ReleaseCapture&quot;&lt;/span&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private extern static void ReleaseCapture();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;[&lt;span style=&quot;color: #3d85c6;&quot;&gt;DllImport&lt;/span&gt;(&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;user32.DLL&quot;&lt;/span&gt;, EntryPoint = &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;SendMessage&quot;&lt;/span&gt;)]&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private extern static void SendMessage(System.IntPtr hWnd, int wMsg, int wParam, int lParam);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Lo siguiente sera agregar el &lt;b&gt;Evento Mouse Down&lt;/b&gt; a nuestro form, que sera el que se activara cuando queramos arrastrar nuestro form:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;private void&lt;/span&gt; Form1_MouseDown(object sender, MouseEventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ReleaseCapture();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SendMessage(this.Handle, 0x112, 0xf012, 0);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Por ultimo solo nos faltara agregar el código para cerrar la aplicación en nuestro botón cerrar:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;private void&lt;/span&gt; button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Application.Exit();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Espero les haya sido de utilidad, saludos.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/6629201757496059668/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/como-mover-form-sin-bordes.html#comment-form' title='15 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/6629201757496059668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/6629201757496059668'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/05/como-mover-form-sin-bordes.html' title='Como mover Form sin Bordes'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpd8otwamHYsF_rxZmwwPX_qs72kcvlF4mA_Rf71h7d7ZC-aIHcOjPVvnLUaL0M0wQO3IjKepGKztMWKw3Hp015kkby4EI_ej9Gyv_5CA-iK5sbWKy67F2dKSzYTmJz3Tshc-9Z0Ogm-oX/s72-c/2012-05-19_120700.png" height="72" width="72"/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-5612773619522494690</id><published>2012-04-30T14:31:00.001-07:00</published><updated>2012-07-20T12:34:15.358-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="Chart c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Control Chart C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="graficos c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Chart en C# - Control para Graficos en Windows Form</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ZBoPN55NmwdoLgsERd_XnnmPkeQS_tyvAsu99aJWkSzMdDKzvVjiQ8Opp_sMDxiZbEc_pW_Ag-jOlj-uDNaMl3oGDt-Hus593ptg2Uiknp7MLNAFUJSCUlcxOJej2zvEzSU0i07EbmWO/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;331&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ZBoPN55NmwdoLgsERd_XnnmPkeQS_tyvAsu99aJWkSzMdDKzvVjiQ8Opp_sMDxiZbEc_pW_Ag-jOlj-uDNaMl3oGDt-Hus593ptg2Uiknp7MLNAFUJSCUlcxOJej2zvEzSU0i07EbmWO/s400/2.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El siguiente articulo es un pequeño tutorial sobre como utilizar el &lt;b&gt;Control &quot;Chart&quot; de .NET&lt;/b&gt; para crear gráficos en una aplicación, en este caso una aplicación para Windows, para su funcionamiento es simple y permite ayudarnos para crear gráficos en alguna de nuestras aplicaciones donde sea necesario este tipo de implementacion, así que tendremos que crear un proyecto nuevo del tipo Windows Form donde necesitaremos principalmente los siguientes componentes:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- 3 Controles Textbox para ingresar los valores al gráfico.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- 2 Botones para las 2 diferentes acciones que realizaremos.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;- 1 Control Chart que si no lo ubican se encuentra en la sección Data de su &lt;b&gt;Visual Studio o Visual C# Express&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;De tal forma que el resultado sea similar al de la imagen mostrada, ahora pasaremos al código para el primer botón que se encargara de asignar los valores al &lt;b&gt;control Chart&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;h2&gt;TUTORIAL C#:&lt;/h2&gt;&lt;/span&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;En el evento clic del botón incluiremos el siguiente código, recuerden que ustedes pueden modificar a su gusto las propiedades del Chart como son la combinación de colores etcétera:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;private void&lt;/span&gt; button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Arreglos del Grafico&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            string[] seriesArray = { &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Categoria 1&quot;&lt;/span&gt;, &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Categoria 2&quot;&lt;/span&gt;, &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Categoria 3&quot;&lt;/span&gt; };&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;           int[] pointsArray = { &lt;span style=&quot;color: #3d85c6;&quot;&gt;Convert&lt;/span&gt;.ToInt32(textBox1.Text), &lt;span style=&quot;color: #3d85c6;&quot;&gt;Convert&lt;/span&gt;.ToInt32(textBox2.Text), &lt;span style=&quot;color: #3d85c6;&quot;&gt;Convert&lt;/span&gt;.ToInt32(textBox3.Text) };&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Se modifica la Paleta de Colores a utilizar por el control.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;           &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.Palette = &lt;span style=&quot;color: #3d85c6;&quot;&gt;ChartColorPalette&lt;/span&gt;.SeaGreen;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Se agrega un titulo al Grafico.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;           &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.Titles.Add(&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Categorias&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Agregar las Series al Grafico.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #3d85c6;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color: #3d85c6;&quot;&gt;int&lt;/span&gt; i = 0; i &amp;lt; seriesArray.Length; i++)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Aqui se agregan las series o Categorias.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;               &lt;span style=&quot;color: #3d85c6;&quot;&gt;Series&lt;/span&gt; series = &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.Series.Add(seriesArray[i]);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;// Aqui se agregan los Valores.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                series.Points.Add(pointsArray[i]);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;           }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Una vez realizado esto ya quedara listo nuestro gráfico para los valores que ingresemos manualmente mediante nuestro formulario, pero como extra a este proyecto ademas podemos exportar nuestro gráfico y guardarlo como imagen con el siguiente &lt;b&gt;código c#&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;private void&lt;/span&gt; button2_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;        {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            &lt;span style=&quot;color: #3d85c6;&quot;&gt;SaveFileDialog&lt;/span&gt; saveFileDialog1 = new &lt;span style=&quot;color: #3d85c6;&quot;&gt;SaveFileDialog&lt;/span&gt;();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            saveFileDialog1.Filter = &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;JPeg Imagen|*.jpg|Bitmap Imagen|*.bmp|PNG Imagen|*.png&quot;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            saveFileDialog1.Title = &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Guardar Grafico en Imagen&quot;&lt;/span&gt;;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            saveFileDialog1.ShowDialog();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            if (saveFileDialog1.FileName != &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;&quot;&lt;/span&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                &lt;span style=&quot;color: #3d85c6;&quot;&gt;System&lt;/span&gt;.IO.FileStream fs =&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                   (&lt;span style=&quot;color: #3d85c6;&quot;&gt;System&lt;/span&gt;.IO.FileStream)saveFileDialog1.OpenFile();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                switch (saveFileDialog1.FilterIndex)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                {&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                    case 1:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                        &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.SaveImage(fs, ChartImageFormat.Jpeg);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;                       break;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                    case 2:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                        &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.SaveImage(fs, ChartImageFormat.Bmp);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp;                       break;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                    case 3:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                        &lt;span style=&quot;color: #3d85c6;&quot;&gt;this&lt;/span&gt;.chart1.SaveImage(fs, ChartImageFormat.Png);&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                        break;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;                fs.Close();&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;            }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;blockquote class=&quot;tr_bq&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana, sans-serif;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NegInternet */
google_ad_slot = &quot;9775563311&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Y con eso tenemos listo nuestro gráfico, ahora podemos explorar otras opciones y jugar un poco con el codigo, espero les haya sido de utilidad saludos.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/5612773619522494690/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/chart-en-c-control-para-graficos-en.html#comment-form' title='41 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/5612773619522494690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/5612773619522494690'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/chart-en-c-control-para-graficos-en.html' title='Chart en C# - Control para Graficos en Windows Form'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0ZBoPN55NmwdoLgsERd_XnnmPkeQS_tyvAsu99aJWkSzMdDKzvVjiQ8Opp_sMDxiZbEc_pW_Ag-jOlj-uDNaMl3oGDt-Hus593ptg2Uiknp7MLNAFUJSCUlcxOJej2zvEzSU0i07EbmWO/s72-c/2.png" height="72" width="72"/><thr:total>41</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-2126998326423362033</id><published>2012-04-29T13:30:00.003-07:00</published><updated>2012-07-10T22:55:50.697-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Aprender C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog en Español"/><category scheme="http://www.blogger.com/atom/ns#" term="Cargar imagen c#"/><category scheme="http://www.blogger.com/atom/ns#" term="copia imagen c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><title type='text'>Crear Copia de Imagen C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;color: #444444;&quot;&gt;Anteriormente&amp;nbsp;había&amp;nbsp;publicado un articulo donde explicaba como &lt;a href=&quot;http://csharpmaniax.blogspot.mx/2012/04/cargar-imagen-en-picturebox-usando.html&quot;&gt;cargar una Imagen en PictureBox&lt;/a&gt;, ahora usaremos el mismo proyecto para hacer otro ejercicio diferente, ahora crearemos una copia de la imagen cargada en nuestro &lt;i&gt;picturebox&lt;/i&gt;, pero ademas tendremos la&amp;nbsp;opción&amp;nbsp;de cambiarle el formato a la imagen, esto lo haremos ya sea modificando ese mismo proyecto o creando uno nuevo, el resultado debe de ser similar al del anterior proyecto, solo que esta vez agregaremos nuevos botones, radioBotones, un Combo o la manera que creas conveniente para el proyecto, ahora pasemos al&amp;nbsp;código.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Ya sea cual sea el método que utilices el &lt;b&gt;código&lt;/b&gt; solo cambiara un poco, en caso de que lo hagas mediante botones que seria la forma mas fácil pero no la mas practica solo tendrías que &lt;b&gt;programar&lt;/b&gt; tus botones así:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;private void&lt;/span&gt; button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;string&lt;/span&gt; NombreArchivo;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NombreArchivo = &lt;span style=&quot;color: #3d85c6;&quot;&gt;System&lt;/span&gt;.IO.Path.GetFileNameWithoutExtension(txtImagen.Text);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Bitmap&lt;/span&gt; Picture = &lt;span style=&quot;color: #0b5394;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #3d85c6;&quot;&gt;Bitmap&lt;/span&gt;(txtImagen.Text);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6aa84f;&quot;&gt;//Cambiando esta Linea es como podemos cambiar el formato de la Copia.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Picture.Save(&lt;span style=&quot;color: #cc0000;&quot;&gt;@&quot;C:\&quot;&lt;/span&gt; + NombreArchivo + &lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;.jpg&quot;&lt;/span&gt;, System.Drawing.Imaging.ImageFormat.Jpeg);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #3d85c6;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Se guardo la Copia correctamente en C:&quot;&lt;/span&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Espero les haya sido de utilidad saludos.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Quizas tambien pueda interesarte:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/2126998326423362033/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/crear-copia-de-imagen-c.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/2126998326423362033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/2126998326423362033'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/crear-copia-de-imagen-c.html' title='Crear Copia de Imagen C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-9174799756199563279</id><published>2012-04-22T22:21:00.000-07:00</published><updated>2012-07-20T12:36:30.306-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Blog C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Leer txt c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Leer Archivo TXT con C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;El siguiente ejemplo muestra como cargar un Archivo de texto y cargarlo en un Textbox, para eso usaremos los controles &lt;b&gt;OpenFileDialog&lt;/b&gt; y &lt;b&gt;SaveFileDialog&lt;/b&gt; para guardar el texto ingresado en el &lt;i&gt;Textbox &lt;/i&gt;en un archivo con&amp;nbsp;extensión&amp;nbsp;txt.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Necesitaremos un Formulario de Windows con un Textbox, donde se mostrara la ruta del archivo, un&amp;nbsp;botón&amp;nbsp;para examinar, un Textbox donde se cargara el texto del archivo y un&amp;nbsp;botón&amp;nbsp;para guardar el texto, una vez terminado esto vamos a la parte del&amp;nbsp;código.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;h2&gt;Tutorial C#:&lt;/h2&gt;&lt;/span&gt;&lt;/span&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;
src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;En el evento clic del Botón para examinar, escribiremos el siguiente &lt;b&gt;código c#&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;private void&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; button1_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;OpenFileDialog&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; openFileDialog1 = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; OpenFileDialog&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.Filter = &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;Archivos txt|*.txt&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.FileName = &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;Seleccione un archivo de Texto&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.Title = &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;Programa de Lectura&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.InitialDirectory = &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;C:\\&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; openFileDialog1.FileName = &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.textBox1.Text;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (openFileDialog1.ShowDialog() == DialogResult.OK)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;this&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.textBox1.Text = openFileDialog1.FileName;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textBox2.Text = &lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;System&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.IO.StreamReader sr = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt; System&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.IO.StreamReader(@textBox1.Text, System.Text.Encoding.Default);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;string&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt; texto;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; texto = sr.ReadToEnd();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sr.Close();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; textBox2.Text = texto;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Hecho esto tendremos lista la lectura de nuestro archivo de texto, lo ultimo para concluir el ejercicio es escribir el código del botón para guardar el texto.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;private void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; button2_Click(object sender, EventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;SaveFileDialog&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; saveFile = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #0b5394;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; SaveFileDialog&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; saveFile.Filter = &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&quot;Ficheros TXT|*.txt&quot;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;if&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; (saveFile.ShowDialog() == DialogResult.OK)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;StreamWriter&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; escrito = File.CreateText(saveFile.FileName);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #3d85c6;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;String&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; contenido = textBox2.Text;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; escrito.Write(contenido.ToString());&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; escrito.Flush();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; escrito.Close();&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: #444444; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Con esto ya podemos trabajar con archivos de texto y probar con otros tipos de documentos, saludos.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/9174799756199563279/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/leer-archivo-txt-con-c.html#comment-form' title='14 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/9174799756199563279'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/9174799756199563279'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/leer-archivo-txt-con-c.html' title='Leer Archivo TXT con C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1076476952979063875</id><published>2012-04-18T22:43:00.003-07:00</published><updated>2012-07-10T22:52:54.221-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog en Español"/><category scheme="http://www.blogger.com/atom/ns#" term="Evitar Cierre Aplicacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion.NET"/><title type='text'>Preguntar por cierre de Aplicación C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;En la gran&amp;nbsp;mayoría&amp;nbsp;de los casos una&amp;nbsp;aplicación&amp;nbsp;debería&amp;nbsp;de poder contar con la posibilidad de preguntarnos si deseamos en realidad cerrarla, debido a que muchas veces las aplicaciones que desarrollamos tienen algunas partes donde estamos capturando cierta&amp;nbsp;información&amp;nbsp;que aun no guardamos y&amp;nbsp;quizás&amp;nbsp;si la cerramos por&amp;nbsp;equivocación&amp;nbsp;nos llevemos un gran disgusto por tener que volver a capturarla,&amp;nbsp;así&amp;nbsp;que por eso les tengo la&amp;nbsp;solución&amp;nbsp;a ese pequeño problema, unas pocas lineas de&amp;nbsp;código&amp;nbsp;con la que le preguntaran al usuario si de verdad desea cerrar una&amp;nbsp;&lt;b&gt;aplicación&lt;/b&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Para hacerlo debemos de posicionarnos en el &lt;i&gt;evento Closing&lt;/i&gt; de nuestro Forma Principal si es que tenemos varios, por si no sabes como acceder a los eventos de una forma basta con estar sobre esta y dar clic en el icono del rayo que se encuentra en la ventana de propiedades, y dar doble clic en donde dice Closing para crear este evento.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Una vez creado el evento tendremos que ingresar el siguiente&amp;nbsp;código:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #6fa8dc;&quot;&gt;private void&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt; Form1_FormClosing(object sender, System.ComponentModel.CancelEventArgs e)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6fa8dc;&quot;&gt;DialogResult&lt;/span&gt; dialogo =&lt;span style=&quot;color: #6fa8dc;&quot;&gt; MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;¿ Desea Salir de la Aplicacion S/N ?&quot;&lt;/span&gt;,&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;Salir de Aplicacion&quot;&lt;/span&gt;, MessageBoxButtons.OKCancel, MessageBoxIcon.Question);&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6fa8dc;&quot;&gt;if&lt;/span&gt; (dialogo == DialogResult.OK) { }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #6fa8dc;&quot;&gt;else &lt;/span&gt;{ e.Cancel = true; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;De esta forma cuando presionemos el&amp;nbsp;botón&amp;nbsp;cerrar o cerremos la forma por&amp;nbsp;algún&amp;nbsp;otro medio nos pedira que confirmemos esa&amp;nbsp;acción, en caso de&amp;nbsp;presionar&amp;nbsp;OK la forma se cerrara y si presionamos Cancelar se cancelara el Close de la Forma, saludos y espero te haya sido de utilidad&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1076476952979063875/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/preguntar-por-cierre-de-aplicacion-c.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1076476952979063875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1076476952979063875'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/preguntar-por-cierre-de-aplicacion-c.html' title='Preguntar por cierre de Aplicación C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-3875368438697835662</id><published>2012-04-17T10:48:00.000-07:00</published><updated>2014-09-26T10:54:30.600-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="sumar datagridview c#"/><category scheme="http://www.blogger.com/atom/ns#" term="sumar datos datagridview"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Sumar Cantidades de un DataGridView</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Cuando no nos ha pasado que tenemos una&amp;nbsp;aplicación&amp;nbsp;que necesita hacer sumas, o restas o cualquier otra&amp;nbsp;operación&amp;nbsp;matemática,&amp;nbsp;quizás&amp;nbsp;en&amp;nbsp;algún&amp;nbsp;momento&amp;nbsp;tendrás&amp;nbsp;que toparte con esta necesidad, mas si estas en&amp;nbsp;algún&amp;nbsp;proyecto tipo &quot;&lt;i&gt;Punto de Venta&lt;/i&gt;&quot; donde este tipo de operaciones son esenciales, bueno te tengo una pequeña y simple&amp;nbsp;solución&amp;nbsp;donde solo necesitaremos un &lt;b&gt;DataGridView&lt;/b&gt; que este previamente llenado con datos, o que se se encuentre abierto a la&amp;nbsp;agregación,&amp;nbsp;edición, etc.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Tutorial C#&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Cuando llenemos el &lt;b&gt;DataGridView&lt;/b&gt; debemos de especificar en&amp;nbsp;algún&amp;nbsp;momento alguna columna de Cantidad, Piezas, Unidades o como desees llamarlo donde&amp;nbsp;tendrás&amp;nbsp;valores&amp;nbsp;numéricos&amp;nbsp;los cuales son los que queremos sumar pues para hacer este proceso basta con hacer este pequeña&amp;nbsp;operación, donde obtendremos el valor de cada celda de una columna que especificaremos con el Nombre &quot;Cantidad&quot;&amp;nbsp;&amp;nbsp;lo recorreremos y asignaremos el valor a un control Label, el&amp;nbsp;código&amp;nbsp;a&amp;nbsp;continuación:&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;//Variable donde almacenaremos el resultado de la sumatoria.
           double sumatoria = 0;
//Método con el que recorreremos todas las filas de nuestro Datagridview
            foreach (DataGridViewRow row in gvGastos.Rows)
            {
//Aquí seleccionaremos la columna que contiene los datos numericos.
                sumatoria += Convert.ToDouble(row.Cells[&quot;Cantidad&quot;].Value);
            }
//Por ultimo asignamos el resultado a el texto de nuestro Label
            lblTotal.Text = Convert.ToString(sumatoria);
&lt;/textarea&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Espero te haya servido esta pequeña&amp;nbsp;información, saludos.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/3875368438697835662/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/sumar-cantidades-de-un-datagridview.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/3875368438697835662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/3875368438697835662'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/sumar-cantidades-de-un-datagridview.html' title='Sumar Cantidades de un DataGridView'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1006270892154794874</id><published>2012-04-17T09:54:00.000-07:00</published><updated>2014-09-26T10:51:06.317-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tips"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial de C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Verificar Aplicación Abierta C#"/><title type='text'>Verificar si una aplicación ya se encuentra Abierta</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Uno de los primeros inconvenientes cuando empezamos a &lt;b&gt;programar en c#&lt;/b&gt; aplicaciones mas completas es que necesitamos que los usuarios no puedan abrir mas de una vez una&amp;nbsp;aplicación&amp;nbsp;que ya se encuentra abierta, para realizar este proceso existen varias formas de hacerlo, ya sea importando una de las APIS de Windows que lo verifica o crear un&amp;nbsp;método&amp;nbsp;para poder verificar si se esta ejecutando un proceso previo que cumple con las&amp;nbsp;características&amp;nbsp;de nuestro&amp;nbsp;programa, esta es la forma que utilizaremos ya que el importar un API de Windows evitara que nuestra&amp;nbsp;aplicación&amp;nbsp;pueda funcionar en Linux o cualquier otros S.O, esto lo podemos hacer de la siguiente forma.&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;Primero que nada tendremos que tener creada la clase &lt;b&gt;Program.cs&lt;/b&gt; que ya a esta altura debemos de saber que es la clase principal donde ira ubicado el &lt;i&gt;método Main&lt;/i&gt; de nuestra aplicación, accesamos al código y creamos un método que contenga la siguiente estructura:&lt;/span&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;private static bool IsExecutingApplication()
        {
            // Proceso actual
            Process currentProcess = Process.GetCurrentProcess();

            // Matriz de procesos
            Process[] processes = Process.GetProcesses();

            // Recorremos los procesos en ejecución
            foreach (Process p in processes)
            {
                if (p.Id != currentProcess.Id)
                {
                    if (p.ProcessName == currentProcess.ProcessName)
                    {
                        return true;
                    }
                }
            }
            return false;
        } 
&lt;/textarea&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Este método almacenara en un arreglo información sobre los procesos que se están ejecutando, &amp;nbsp;y mas en especifico sobre nuestro proceso, para después recorrer el arreglo y verificar si nuestro proceso se encuentra en ejecución si es así nos regresara Verdadero , en caso contrario falso, lo único que nos falta es agregar el uso del método, en el método Main.&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            // Ejecutamos la aplicación siempre y cuando no se esté ejecutando ya.
            //
            if (IsExecutingApplication() == false)
            {
                Application.Run(new Form1());
            }
            else
            {
                
            }
        }
&lt;/textarea&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;De esta forma podremos Hacer esa&amp;nbsp;comprobación&amp;nbsp;para nuestras aplicaciones, espero te haya sido de utilidad saludos.&lt;/span&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1006270892154794874/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/verificar-si-una-aplicacion-ya-se.html#comment-form' title='7 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1006270892154794874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1006270892154794874'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/verificar-si-una-aplicacion-ya-se.html' title='Verificar si una aplicación ya se encuentra Abierta'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-1909142571377763019</id><published>2012-04-08T21:37:00.000-07:00</published><updated>2014-09-26T10:48:49.664-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Añadir Items a Listbox C#"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial de C#"/><title type='text'>Añadir Items a un ListBox desde un Control Textbox C#</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMn0IS3N13YHg-U7I40aXixBPIbeNHmoySRNZOkD7w1TRqBXFQp3t7Hodf5uUgQ7mSnWx2ytnycBxnuqC5HS89yCqkUijZPTdsVHY389WdQY9fmsnqRA0OhIsxmWSx8M-J_iogIv5zMFB/s1600/ListBox+C%23.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMn0IS3N13YHg-U7I40aXixBPIbeNHmoySRNZOkD7w1TRqBXFQp3t7Hodf5uUgQ7mSnWx2ytnycBxnuqC5HS89yCqkUijZPTdsVHY389WdQY9fmsnqRA0OhIsxmWSx8M-J_iogIv5zMFB/s1600/ListBox+C%23.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Uno de los controles que mas usaremos en nuestra&amp;nbsp;&lt;b&gt;programación&amp;nbsp;en c#&lt;/b&gt; al momento de desarrollar aplicaciones de escritorio sera el &lt;i&gt;Listbox,&lt;/i&gt; existen diferentes formas de añadir Items a este control, para hacerlo siempre usaremos el&amp;nbsp;método&amp;nbsp;Add de la propiedad Item del control.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Un ejemplo muy sencillo de hacerlo es agregando el texto de un control &lt;i&gt;Textbox&amp;nbsp;&lt;/i&gt;pasándoselo&amp;nbsp;como&amp;nbsp;parámetro&amp;nbsp;al&amp;nbsp;Método&amp;nbsp;de&amp;nbsp;agregación&amp;nbsp;del control, para este ejemplo creamos una forma como la de la imagen, con un Listbox, un Textbox y un&amp;nbsp;Botón, dentro del cual ira el siguiente&amp;nbsp;&lt;b&gt;código c#&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;private void button1_Click(object sender, EventArgs e) 
{
   listBox1.Items.Add(textBox1.Text); 
//Aqui es donde pasamos el parámetro
   textBox1.Text = &quot;&quot;;
   textBox1.Focus(); 
}
&lt;/textarea&gt;&lt;br /&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Espero les haya sido de utilidad.&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/1909142571377763019/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/anadir-items-un-listbox-desde-un.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1909142571377763019'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/1909142571377763019'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/anadir-items-un-listbox-desde-un.html' title='Añadir Items a un ListBox desde un Control Textbox C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwMn0IS3N13YHg-U7I40aXixBPIbeNHmoySRNZOkD7w1TRqBXFQp3t7Hodf5uUgQ7mSnWx2ytnycBxnuqC5HS89yCqkUijZPTdsVHY389WdQY9fmsnqRA0OhIsxmWSx8M-J_iogIv5zMFB/s72-c/ListBox+C%23.png" height="72" width="72"/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-6332114350018396338</id><published>2012-04-07T13:53:00.003-07:00</published><updated>2014-09-26T10:47:25.419-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Cargar imagen c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Cargar Imagen PictureBox c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Ejercicios C#"/><category scheme="http://www.blogger.com/atom/ns#" term="openfiledialog c#"/><category scheme="http://www.blogger.com/atom/ns#" term="Progracion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Cargar Imagen en PictureBox usando OpenFileDialog con C#</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir9iuVD3rA7kI-lnf6cKpG50EeDPSjpM0xRkc6Hql_JH6vmKFjsUaqhn7N13RJ78tlGP8u3a2NJ-wt2Js-FLK6lu8Ehg_SBoOeZg6gmX9s6FbykRCCn6QN-90oX-69_02vyvd_tVJIQGRd/s1600/Cargar+Imagen+C%23.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir9iuVD3rA7kI-lnf6cKpG50EeDPSjpM0xRkc6Hql_JH6vmKFjsUaqhn7N13RJ78tlGP8u3a2NJ-wt2Js-FLK6lu8Ehg_SBoOeZg6gmX9s6FbykRCCn6QN-90oX-69_02vyvd_tVJIQGRd/s1600/Cargar+Imagen+C%23.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;El siguiente ejemplo les&amp;nbsp;servirá&amp;nbsp;para cargar una Imagen a un Control &lt;b&gt;PictureBox&lt;/b&gt; usando el &lt;b&gt;OpenFileDialog&lt;/b&gt; para buscar la imagen dentro del equipo, para lograr este resultado el siguiente ejemplo muestra una forma de hacerlo, claro que podras modificarlo a tu gusto, solo necesitamos lo siguiente:&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Un Proyecto en &lt;b&gt;C#&lt;/b&gt; del tipo &lt;b&gt;Windows Form&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Un &lt;i&gt;Control Picture Box&lt;/i&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Un Boton.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Opcionalmente un control del Tipo &lt;b&gt;TextBox&lt;/b&gt; si quieren mostrar la ruta de la imagen.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;A&amp;nbsp;continuación&amp;nbsp;observaremos el&amp;nbsp;código&amp;nbsp;para lograr cargar la imagen en el control PictureBox presionando el&amp;nbsp;Botón.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;b&gt;Tutorial C#&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;/span&gt;
&lt;span style=&quot;font-size: small;&quot;&gt;Lo primero que debemos hacer es acceder al evento Clic de nuestro Boton y escribir el siguiente&amp;nbsp;&lt;b&gt;código c#&lt;/b&gt;:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;private void button1_Click(object sender, EventArgs e)         
{
            OpenFileDialog BuscarImagen = new OpenFileDialog();             BuscarImagen.Filter = &quot;Archivos de Imagen|*.jpg&quot;; 
//Aquí incluiremos los filtros que queramos.
            BuscarImagen.FileName = &quot;&quot;;
            BuscarImagen.Title = &quot;Titulo del Dialogo&quot;;
            BuscarImagen.InitialDirectory = &quot;C:\\&quot;;             BuscarImagen.FileName = this.textBox1.Text;
            if (BuscarImagen.ShowDialog() == DialogResult.OK){
       /// Si esto se cumple, capturamos la propiedad File Name y la guardamos en el control
                this.textBox1.Text = BuscarImagen.FileName;                                 String Direccion = BuscarImagen.FileName;                 this.pictureBox1.ImageLocation = Direccion;              
//Pueden usar tambien esta forma para cargar la Imagen solo activenla y comenten la linea donde se cargaba anteriormente 
                //this.pictureBox1.ImageLocation = textBox1.Text;
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; 
            }         
}
&lt;/textarea&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;code&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;code&gt;
&lt;/code&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Con esto es mas que suficiente, recuerden que ustedes pueden cambiar las propiedades del control, y elegir las que mejor les convenga, saludos.&lt;/span&gt;
&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/6332114350018396338/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/cargar-imagen-en-picturebox-usando.html#comment-form' title='10 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/6332114350018396338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/6332114350018396338'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/04/cargar-imagen-en-picturebox-usando.html' title='Cargar Imagen en PictureBox usando OpenFileDialog con C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEir9iuVD3rA7kI-lnf6cKpG50EeDPSjpM0xRkc6Hql_JH6vmKFjsUaqhn7N13RJ78tlGP8u3a2NJ-wt2Js-FLK6lu8Ehg_SBoOeZg6gmX9s6FbykRCCn6QN-90oX-69_02vyvd_tVJIQGRd/s72-c/Cargar+Imagen+C%23.png" height="72" width="72"/><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-515509034727503910</id><published>2012-02-01T11:11:00.000-08:00</published><updated>2014-09-26T10:44:32.994-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Crear DataTable desde codigo"/><category scheme="http://www.blogger.com/atom/ns#" term="DataTable"/><category scheme="http://www.blogger.com/atom/ns#" term="Llenar un datatable desde codigo"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Crear un DataTable desde Codigo</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Anteriormente había abordado en algunos post como usar Datatables, tanto para llenar DataGridview, usarlos para generar archivos CSV, como recorrerlos etc., sin embargo estos ejemplos eran o usando una BD o cargándolos desde algún archivo externo, si quieres construir un Datatable desde 0 y totalmente desde código este pequeño &lt;b&gt;Tutorial C#&lt;/b&gt; te orientara un poco.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Un Datatable segun el &lt;b&gt;MSDN&lt;/b&gt; es:&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Un objeto central de la biblioteca ADO.NET. Entre los objetos que utilizan DataTable se incluyen DataSet y DataView.&lt;/span&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;El Datatable no es mas que una Tabla con datos, y como tal tiene una estructura de tabla parecida a la de las tablas en HTML por poner un ejemplo, tiene Columnas y tiene Filas, y estas deben coincidir en numero, para construir un Datatable desde código puedes ver el siguiente ejemplo, donde construiremos un datatable con 2 columnas y le agregaremos filas:&lt;/span&gt;&lt;/div&gt;
&lt;textarea cols=&quot;80&quot; readonly=&quot;&quot; rows=&quot;10&quot;&gt;DataTable tabla = new DataTable();

//Para agregar las columnas y darles un nombre haremos lo siguiente:

tabla.Columns.Add(&quot;Columna1&quot;);
tabla.Columns.Add(&quot;Columna2&quot;);

//Para agregar Filas lo haremos de la siguiente forma: crearemos un objeto DataRow al que le asignaremos valores y después lo agregaremos al DataTable.

DataRow fila = tabla.NewRow();

fila[&quot;Columna1&quot;] = &quot;Dato1&quot;;
fila[&quot;Columna2&quot;] = &quot;Dato2&quot;;

//Por ultimo agregamos la fila que ya tiene datos asignados.
tabla.Rows.Add(fila);
&lt;/textarea&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/code&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Con este ejemplo sencillo podrás conocer como construir un Datatable desde 0, para poderle dar un mejor uso a este ejemplo te recomiendo juegues un poco con este código, envíes valores o llenes algún DataGridview con el para que sea mas visible el ejemplo, saludos.&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* CSharpBanner */
google_ad_slot = &quot;6781625863&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/515509034727503910/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/08/crear-un-datatable-desde-codigo.html#comment-form' title='6 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/515509034727503910'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/515509034727503910'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/08/crear-un-datatable-desde-codigo.html' title='Crear un DataTable desde Codigo'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-7529464532454674485</id><published>2012-01-04T22:50:00.000-08:00</published><updated>2014-09-26T10:42:54.615-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Aprender C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Blog C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Resumen del Lenguaje C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Resumen del Lenguaje C#</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;b&gt;C#&lt;/b&gt; como cualquier otro lenguaje de&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;programación tiene una estructura, tiene su forma de escribirse sus palabras reservadas y esto debe de conocerse si se quiere empezar a programar ya que es lo&amp;nbsp;básico&amp;nbsp;del lenguaje, anteriormente&amp;nbsp;escribí&amp;nbsp;un articulo donde ampliamente sugiero visitar la&amp;nbsp;sección&amp;nbsp;de &lt;i&gt;MSDN&lt;/i&gt; para aprender mas sobre C#. Sin embargo aun&amp;nbsp;así&amp;nbsp;veamos un poco mas sobre el lenguaje, empecemos con lo&amp;nbsp;básico.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h2&gt;
&lt;b&gt;&lt;span style=&quot;color: #444444;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;Caracteres de C#&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Letras de la &#39;a&#39; a la &#39;z&#39; mayúsculas y minúsculas, ademas de las letras acentuadas, la &#39;ñ&#39;, y el &#39;_&#39;. El lenguaje &lt;b&gt;C#&lt;/b&gt; distingue entre mayúsculas y minúsculas, por lo que no es lo mismo &quot;Key&quot; que &quot;key&quot;, por ejemplo.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Dígitos: del 0 al 9.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Caracteres Especiales: . ; : () &#39;&#39; + % $ # etc.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;-Terminadores de Linea: CR y NL.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;- Secuencias de escape: \n \t \r \a \udddd.&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NegInternet */
google_ad_slot = &quot;9775563311&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;Comentarios&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Cuando una linea de&amp;nbsp;código, sirve tan solo para dar una breve&amp;nbsp;información&amp;nbsp;sobre para que sirve se puede comentar de las siguientes 2 maneras:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Una forma sencilla pero que solo funciona linea por linea es usando: //Comentario.&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;La otra puede abarcar un gran bloque de&amp;nbsp;código&amp;nbsp;y puede servir para comentar bloques de codigo que aun no&amp;nbsp;están&amp;nbsp;terminados para que no se ejecuten: &amp;nbsp;/* Bloque de Codigo */.&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace;&quot;&gt;Tipos&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NI728X15 */
google_ad_slot = &quot;4686706612&quot;;
google_ad_width = 728;
google_ad_height = 15;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Los &lt;b&gt;&lt;i&gt;tipos en C#&lt;/i&gt;&lt;/b&gt; se clasifican en: tipos valor y tipos referencia. Una variable de un tipo de valor almacena diferente un valor, mientras que una variable de referencia lo que permite es almacenar una referencia a un objeto, ejemplo:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;int numero = 0; Almacena un dato entero ya definido.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;string palabra = null; Puede almacenar cualquier valor del tipo string, y puede cambiar en cualquier parte del&amp;nbsp;código.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;La siguiente tabla resume los tipos de datos en &lt;b&gt;C#&lt;/b&gt;:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_EmuvA93reRQcEsPxqnKVz9ja9ueT8TY8ciirGPPxe00TjsttEPwb9gztVCJwugxRPFLQKIxrCfdCM-O7iv40-wcLemvrBMg8C6g2UyMAazweagdNosXij_F1qeN2SsmJIJWPmXh3RB_g/s1600/variables+c+sharp.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_EmuvA93reRQcEsPxqnKVz9ja9ueT8TY8ciirGPPxe00TjsttEPwb9gztVCJwugxRPFLQKIxrCfdCM-O7iv40-wcLemvrBMg8C6g2UyMAazweagdNosXij_F1qeN2SsmJIJWPmXh3RB_g/s1600/variables+c+sharp.JPG&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Esto es lo mas&amp;nbsp;básico&amp;nbsp;sobre el lenguaje y en los&amp;nbsp;próximos&amp;nbsp;artículos&amp;nbsp;tocaremos el tema, de las Literales, Identificadores y las palabras Clave.&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/7529464532454674485/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/resumen-del-lenguaje-c.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7529464532454674485'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/7529464532454674485'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/resumen-del-lenguaje-c.html' title='Resumen del Lenguaje C#'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_EmuvA93reRQcEsPxqnKVz9ja9ueT8TY8ciirGPPxe00TjsttEPwb9gztVCJwugxRPFLQKIxrCfdCM-O7iv40-wcLemvrBMg8C6g2UyMAazweagdNosXij_F1qeN2SsmJIJWPmXh3RB_g/s72-c/variables+c+sharp.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3608165024229233384.post-5471311195171815620</id><published>2012-01-02T18:12:00.000-08:00</published><updated>2014-09-26T10:42:36.536-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term=".NET Framework"/><category scheme="http://www.blogger.com/atom/ns#" term="C# Blog Español"/><category scheme="http://www.blogger.com/atom/ns#" term="Introduccion a .NET"/><category scheme="http://www.blogger.com/atom/ns#" term="Programacion C#"/><category scheme="http://www.blogger.com/atom/ns#" term="Tutorial C#"/><title type='text'>Introducción a Microsoft .NET</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSenyIITpN_aHrCGpvxCXq4gylQCfcKA9nmuPlQKCvYKRht51oNjK1YnFmd66uLcey_e7q4rAYWcesbktvxLIAzuKZ-9ZZp9n2iuSeW_pHUvbFTyUBgeYbkplDITxsjGi9nZha260yY2yy/s1600/Microsoft.net.png&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSenyIITpN_aHrCGpvxCXq4gylQCfcKA9nmuPlQKCvYKRht51oNjK1YnFmd66uLcey_e7q4rAYWcesbktvxLIAzuKZ-9ZZp9n2iuSeW_pHUvbFTyUBgeYbkplDITxsjGi9nZha260yY2yy/s200/Microsoft.net.png&quot; height=&quot;190&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Para algunos autores &lt;b&gt;.NET&lt;/b&gt; sugiere la tercera&amp;nbsp;generación&amp;nbsp;en la Web, siendo la primera&amp;nbsp;generación&amp;nbsp;la que trabajaba&amp;nbsp;únicamente&amp;nbsp;con&amp;nbsp;información&amp;nbsp;estática, la segunda&amp;nbsp;generación&amp;nbsp;o la &lt;i&gt;Web 2.0&lt;/i&gt; creo un nuevo modo de ver y navegar en Internet, con aplicaciones que&amp;nbsp;podían&amp;nbsp;interactuar con personas como por ejemplo aplicaciones como los carros de comercio&amp;nbsp;electrónico. La terecera generacion se caracteriza por aplicaciones que pueden interactuar con otras&amp;nbsp;aplicación, un ejemplo muy practico de todo esto es la familia de Productos de &lt;i&gt;Google&lt;/i&gt;, que con una misma cuenta podemos interactuar entre su red social, Youtube el buscador, Gmail o su Navegador &lt;i&gt;Google Chrome&lt;/i&gt;. Pero dejemos a un lado los conceptos sobre la nueva&amp;nbsp;generación&amp;nbsp;de la web y enfoquemonos mas en el tema, la &lt;b&gt;plataforma .NET&lt;/b&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #444444; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h2&gt;

&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;Plataforma .NET&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;Micrososoft .NET&lt;/b&gt; extendiende las ideas de Internet y Sistema Operativo haciendo de la propia Internet la base de un nuevo sistema Operativo. Esto puede permitir a los desarrolladores crear programas que trasciendan los limites entre dispositivos, aprovechen la conectividad de&amp;nbsp;Internet&amp;nbsp;y conectar sus aplicaciones con el resto del mundo. Para realizar esta tarea .NET provee los siguientes componentes&amp;nbsp;básicos:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Herramienta de programacion con soporte para Multilenguajes: &lt;i&gt;Visual Studio .NET&lt;/i&gt; y &lt;i&gt;.NET Framework.&lt;/i&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Infraestructura de Servidores.&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Software de dispositivos .NET.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;color: #444444; font-size: large;&quot;&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;
&lt;h2&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;.NET Framework&lt;/b&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Cuando&amp;nbsp;surgió&amp;nbsp;.NET claramente se necesitaba una infraestructura, no solo para facilitar el desarrollo de aplicaciones,&amp;nbsp;también&amp;nbsp;se necesitaba para encontrar un servicio Web e integrarlo todo en una&amp;nbsp;aplicación&amp;nbsp;que resulte transparente tanto para usuarios como para nosotros los desarrolladores, es por eso que &lt;b&gt;.NET Framework&lt;/b&gt; proporciona esta infraestructura:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-H7zSMXFriBPW0zN1upVnqM-9qB4SvLY16F6Sodca-b3kYKfyf4c49oIhCPiXWWuRIVoQmPdlnsSU60QhlQNuawNfNrK9RIZ3Gv24wouw8eRkB6GPtcVQrDp-lVlIi-8aDMoOTyi5l8mD/s1600/arquitecturaframework.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;color: black; font-family: Courier New, Courier, monospace;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-H7zSMXFriBPW0zN1upVnqM-9qB4SvLY16F6Sodca-b3kYKfyf4c49oIhCPiXWWuRIVoQmPdlnsSU60QhlQNuawNfNrK9RIZ3Gv24wouw8eRkB6GPtcVQrDp-lVlIi-8aDMoOTyi5l8mD/s1600/arquitecturaframework.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;color: #444444; font-family: Courier New, Courier, monospace; font-size: large;&quot;&gt;&lt;b&gt;Especificación&amp;nbsp;común&amp;nbsp;para cada uno de los lenguajes de la familia .NET&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;.NET Framework&lt;/b&gt; proporciona un entorno unificado para cada uno de los integrantes de la familia, como pueden ser los siguientes lenguajes:&lt;/span&gt;&lt;/div&gt;
&lt;ul&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Visual Basic .NET&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;b&gt;C#&lt;/b&gt;&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;C++.NET&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;JScript&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;J# y F# (recientemente)&lt;/span&gt;&lt;/li&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Ademas se dejo abierto para que otros lenguajes pudieran utilizar el &lt;i&gt;Framework&lt;/i&gt;. Otra de las facilidades que brinda .NET es poder interactuar entre lenguajes, utilizar clases en Visual Basic y otras en &lt;b&gt;C#&lt;/b&gt; por ejemplo, no se puede programar 2 lenguajes en la misma clase o mismo Proyecto pero si en la misma&amp;nbsp;solución, utilizando herencia por ejemplo.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;span style=&quot;font-size: small;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
&lt;!--
google_ad_client = &quot;ca-pub-3187079493689662&quot;;
/* NegInternet */
google_ad_slot = &quot;9775563311&quot;;
google_ad_width = 468;
google_ad_height = 60;
//--&gt;
&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: small;&quot;&gt;Y bien estos son los principios&amp;nbsp;básicos&amp;nbsp;de .NET y sus bondades, aun hay mucha nueva&amp;nbsp;información&amp;nbsp;y cada vez se va actualizando mas,&amp;nbsp;así&amp;nbsp;que estar atentos, saludos.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://csharpmaniax.blogspot.com/feeds/5471311195171815620/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/introduccion-microsoft-net.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/5471311195171815620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3608165024229233384/posts/default/5471311195171815620'/><link rel='alternate' type='text/html' href='http://csharpmaniax.blogspot.com/2012/06/introduccion-microsoft-net.html' title='Introducción a Microsoft .NET'/><author><name>SoyFloley</name><uri>http://www.blogger.com/profile/18177607003011131215</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4-3bJVhvlQYjdJ4OAnoLuWta-d6O2P6-JTfbmYvnqlsu7vZo6Y45p-BNNeoFm0Cdy2-r76S0aqAln7jwFKB84ztDEIV7q5YbaMXUe8IV7Cb6Ql2gF7Ix-vKEGr8-1QQ/s113/SoyFloley-n11.png'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSenyIITpN_aHrCGpvxCXq4gylQCfcKA9nmuPlQKCvYKRht51oNjK1YnFmd66uLcey_e7q4rAYWcesbktvxLIAzuKZ-9ZZp9n2iuSeW_pHUvbFTyUBgeYbkplDITxsjGi9nZha260yY2yy/s72-c/Microsoft.net.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>