<?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-7405922360324420417</id><updated>2024-10-24T07:27:59.400-07:00</updated><title type='text'>Solo .Net</title><subtitle type='html'>Blog de todo lo referente a .Net Framework.&#xa;Visitanos y descubre con nosotros los secretos de este framework de programación.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-7564107578856163471</id><published>2018-01-15T15:27:00.004-08:00</published><updated>2018-01-15T15:27:52.465-08:00</updated><title type='text'>Muere Dolores O&#39;Riordan</title><content type='html'>Me acabo de enterar que murió Dolores O&#39;Riordan.&lt;br /&gt;
Descanse en paz </content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/7564107578856163471/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2018/01/muere-dolores-oriordan.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7564107578856163471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7564107578856163471'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2018/01/muere-dolores-oriordan.html' title='Muere Dolores O&#39;Riordan'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-3585030354462076630</id><published>2016-09-25T12:43:00.002-07:00</published><updated>2016-09-25T12:43:45.168-07:00</updated><title type='text'>Administración de procesos dotnet en Linux</title><content type='html'>Tiene poco tiempo que se libero la primera versión .Net core y todavía son escasas las herramientas y librerías disponibles para administrar y programar en este nuevo ambiente.&lt;br /&gt;
Por ejemplo, para usarlo con httpd, es necesario configurar httpd como un proxy inverso y ejecutar los sitios web uno por uno de forma manual.&lt;br /&gt;
Esto es engorroso sobre todo si tienes varios sitios, si necesitas reiniciar el servidor por ejemplo tienes que reiniciar una cantidad de procesos de forma manual, ademas cada programa en su propia ventana de screen problablemente.&lt;br /&gt;
Afortunadamente encontré este programa que es algo asi como la herramienta administrativa de servicios, ella das de alta tus sitios web de .Net core los habilitas o deshabilitas y se ejecutan de forma automática al iniciar el programa que es en si mismo un sitio web de .Net Core y por ello puedes realizar el control desde otro equipo.&lt;br /&gt;
Se llama Core Manager y esta disponible en esta dirección:&lt;br /&gt;
&lt;a href=&quot;http://www.stersoft.com/node/2&quot;&gt;Core Manager&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Puedes registrarlo como un servicio de systemd y al reiniciar tu equipo no tendrás que preocuparte por reiniciar todos los sitios uno por uno, ademas cada sitio pertenece a un grupo y puedes detener o reiniciar todos los procesos de un grupo en una sola operación lo que es útil si están relacionados por ejemplo, que usen el mismo código fuente y de esta forma los reinicias al actualizar los binarios.&lt;br /&gt;
Recuerden lo pueden obtener en &lt;a href=&quot;http://www.stersoft.com/node/2&quot;&gt;Core Manager de SterSoft.&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/3585030354462076630/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2016/09/administracion-de-procesos-dotnet-en.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3585030354462076630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3585030354462076630'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2016/09/administracion-de-procesos-dotnet-en.html' title='Administración de procesos dotnet en Linux'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-4599568630392995965</id><published>2014-05-11T15:40:00.000-07:00</published><updated>2014-05-11T15:40:51.008-07:00</updated><title type='text'>Quitando la pestaña de previsualización en Visual Studio</title><content type='html'>Desde Visual Studio 2012 aparecio la caracteristica de la &quot;pestaña de previsualización&quot;.&lt;br /&gt;
Consiste en que cada archivo que se seleccione en el explorador de soluciones se muestra en un pestaña especia de previsualización en esta solo se muestra un documento que cambia según la selección del explorador de soluciones.&lt;br /&gt;
A mi me parece muy molesta esta caracteristica, quiza solo sea falta de costumbre, pero bueno aquí va la forma de eliminarlo:&lt;br /&gt;
&lt;br /&gt;
Se va uno a Herramientas-&amp;gt;Opciones-&amp;gt;Pestañas y ventanas y se quita la opción &quot;Permitir que los archivos se abran el pestaña de previsuzalización&quot;&lt;br /&gt;
&lt;br /&gt;
Listo</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/4599568630392995965/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2014/05/quitando-la-pestana-de-previsualizacion.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4599568630392995965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4599568630392995965'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2014/05/quitando-la-pestana-de-previsualizacion.html' title='Quitando la pestaña de previsualización en Visual Studio'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-6266331368314253216</id><published>2013-09-11T17:09:00.001-07:00</published><updated>2013-09-11T17:09:48.513-07:00</updated><title type='text'>Audio y video con gstreamer</title><content type='html'>Una opción para la programación de audio y video en .Net es gstreamer, esta es una librería cross platform que funciona en windows, linux osx y android por lo que con el diseño adecuado tu aplicación puede funcionar en todas estas plataformas.&lt;br /&gt;
En cuanto a .Net el soporte se da a través de la librería gstreamer-sharp que es un binding basado en interop para acceder a las dlls nativas.&lt;br /&gt;
Esta librería no se encuentra en el &lt;a href=&quot;http://gstreamer.freedesktop.org/data/pkg/windows/1.0.10/&quot;&gt;sdk oficial&lt;/a&gt; pero puedes obtenerla en la &lt;a href=&quot;http://code.google.com/p/ossbuild/downloads/list&quot;&gt;pagina de ossbuild&lt;/a&gt; que tiene instaladores del sdk que incluyen las dlls para .Net.&lt;br /&gt;
&lt;br /&gt;
Es muy fácil de usar aquí el ejemplo, unas pocas lineas de código que hacen todo:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gst;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; ConsoleApplication1 {&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; PlayBinTest {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; Element pipeline = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Main(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;[] args) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            Application.Init();&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            pipeline = Gst.Parse.Launch(&lt;span class=&quot;str&quot;&gt;&quot;playbin uri=http://localhost:8000/&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            pipeline.SetState(State.Playing);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            Bus bus = pipeline.Bus;&lt;/pre&gt;
&lt;pre&gt;            bus.AddWatch(EventLoop);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;            Gst.GLib.MainLoop loop = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Gst.GLib.MainLoop();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            loop.Run();&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            pipeline.SetState(State.Null);&lt;/pre&gt;
&lt;pre&gt;            System.Console.ReadLine();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; EventLoop(Bus bus, Message msg) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;switch&lt;/span&gt;(msg.Type) {&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; MessageType.Eos: {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                        msg.Dispose();&lt;/pre&gt;
&lt;pre&gt;                        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                    }&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;case&lt;/span&gt; MessageType.Error: {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                        System.Console.WriteLine(msg.Structure.ToString());&lt;/pre&gt;
&lt;pre&gt;                            pipeline.SetState(State.Ready);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                            pipeline[&lt;span class=&quot;str&quot;&gt;&quot;uri&quot;&lt;/span&gt;] = &lt;span class=&quot;str&quot;&gt;&quot;http://localhost:8000&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;                            pipeline.SetState(State.Playing);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;                    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                }&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/6266331368314253216/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/09/audio-y-video-con-gstreamer.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6266331368314253216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6266331368314253216'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/09/audio-y-video-con-gstreamer.html' title='Audio y video con gstreamer'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-2021381452174469048</id><published>2013-08-02T18:49:00.002-07:00</published><updated>2013-08-02T18:49:19.337-07:00</updated><title type='text'>Creando sistemas de archivos con .net</title><content type='html'>Si quieres desarrollar sistemas de archivos para Linux una buena alternativa es &lt;a href=&quot;http://www.jprl.com/Projects/mono-fuse.html&quot;&gt;Mono.Fuse&lt;/a&gt; un proyecto que usa internamente &lt;a href=&quot;http://fuse.sourceforge.net/&quot;&gt;FUSE&lt;/a&gt;, que es la forma mas conocida de crear sistemas de archivos a nivel de usuario en Linux.&lt;br /&gt;
&lt;br /&gt;
Simplemente tienes que implementar las funciones que heredas de un clase incluida en la librería y listo, por ejemplo implementas OnReadSymbolicLink para obtener la dirección a la que apunta un enlace simbólico.&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/2021381452174469048/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/08/creando-sistemas-de-archivos-con-net.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2021381452174469048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2021381452174469048'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/08/creando-sistemas-de-archivos-con-net.html' title='Creando sistemas de archivos con .net'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-4782901414524293070</id><published>2013-07-24T20:06:00.002-07:00</published><updated>2013-07-24T20:06:40.473-07:00</updated><title type='text'>Visual Studio no depura</title><content type='html'>A veces cuando queremos depurar un programa en Visual Studio 2010 el entorno no inicia la depuración, el proyecto se compila sin problemas pero el programa no inicia.&lt;br /&gt;
Esto puede deberse al que el proceso vshost del programa &quot;se colgó&quot;, para solucionar esto hay que abrir el administrador de tareas y matar el proceso, después de esto se debe iniciar la depuración la próxima vez.</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/4782901414524293070/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/07/visual-studio-no-depura.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4782901414524293070'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4782901414524293070'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/07/visual-studio-no-depura.html' title='Visual Studio no depura'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-9097817707974148278</id><published>2013-07-18T20:54:00.001-07:00</published><updated>2013-07-18T20:54:11.146-07:00</updated><title type='text'>Xamarin crece</title><content type='html'>Xamarin nos anuncia que la empresa esta creciendo, esperemos que esto signifique una mejora en la calidad de Mono y de sus otros productos.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://blog.xamarin.com/xamarin-raises-16-million/?mkt_tok=3RkMMJWWfF9wsRonv6TNZKXonjHpfsX57%2B4kWKC2lMI%2F0ER3fOvrPUfGjI4ASsRqI%2BSLDwEYGJlv6SgFQ7fAMapvwrgKXRg%3D&quot;&gt;http://blog.xamarin.com/xamarin-raises-16-million/?mkt_tok=3RkMMJWWfF9wsRonv6TNZKXonjHpfsX57%2B4kWKC2lMI%2F0ER3fOvrPUfGjI4ASsRqI%2BSLDwEYGJlv6SgFQ7fAMapvwrgKXRg%3D&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/9097817707974148278/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/07/xamarin-crece.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/9097817707974148278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/9097817707974148278'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/07/xamarin-crece.html' title='Xamarin crece'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-2542261706274520378</id><published>2013-07-07T17:50:00.002-07:00</published><updated>2013-07-07T17:50:33.326-07:00</updated><title type='text'>Lista de articulos acerca de Gtk Sharp</title><content type='html'>Esta es una lista de artículos acerca de &lt;b&gt;Gtk sharp&lt;/b&gt; disponibles en este blog:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.solonetframework.com/2013/06/menus-en-click-derecho-de-gkt-sharp.html&quot;&gt;&lt;b&gt;Menus en click derecho de Gkt sharp&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.solonetframework.com/2013/06/cambiar-de-tamano-automaticamente-la.html&quot;&gt;&lt;b&gt;Cambiar de tamaño automaticamente la imagen de un Gtk.Image&lt;/b&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;a href=&quot;http://www.solonetframework.com/2013/06/gtk-builder-en-net.html&quot;&gt;Gtk Builder en .Net&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/2542261706274520378/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/07/lista-de-articulos-acerca-de-gtk-sharp.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2542261706274520378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2542261706274520378'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/07/lista-de-articulos-acerca-de-gtk-sharp.html' title='Lista de articulos acerca de Gtk Sharp'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-3034059621237472231</id><published>2013-06-30T18:58:00.002-07:00</published><updated>2013-06-30T18:59:34.265-07:00</updated><title type='text'>Usando Invoke con una expresión Lambda</title><content type='html'>A veces queremos usar el método Invoke de un control o form de Windows.Forms sin llenarnos de delegados, simplemente escribir el código en el lugar donde se usa, para esto podemos debemos &quot;castear&quot; la expresión a un objeto Action, muy simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;Invoke((Action)(() =&amp;gt; {&lt;/pre&gt;
&lt;pre&gt;    Close();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}));&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/3034059621237472231/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/usando-invoke-con-una-expresion-lambda.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3034059621237472231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3034059621237472231'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/usando-invoke-con-una-expresion-lambda.html' title='Usando Invoke con una expresión Lambda'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-5884370739242934263</id><published>2013-06-21T17:21:00.001-07:00</published><updated>2013-06-21T17:21:23.478-07:00</updated><title type='text'>Menus en click derecho de Gkt sharp</title><content type='html'>Pues resulta que en gtk los menús no aparecen cuando se da click derecho, afortunadamente Dave Glick ha publicado &lt;a href=&quot;http://somedave.wordpress.com/2010/04/12/right-click-context-menus-in-gtksharp/&quot;&gt;esta clase&lt;/a&gt; para solucionarlo.&lt;br /&gt;
Les incluyo el código ligeramente modificado si no quieren navegar a otra pagina:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gdk;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; GLib;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gtk;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Somedave {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; ContextMenuEventArgs: EventArgs {&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Widget widget;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; Widget Widget { &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; widget; } }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; rightClick;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; RightClick { &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; { &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; rightClick; } }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ContextMenuEventArgs(Widget widget, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; rightClick) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.widget = widget;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;.rightClick = rightClick;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; ContextMenuHelper {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt; EventHandler&amp;lt;ContextMenuEventArgs&amp;gt; ContextMenu;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ContextMenuHelper() { }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ContextMenuHelper(Widget widget) {&lt;/pre&gt;
&lt;pre&gt;            AttachToWidget(widget);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ContextMenuHelper(Widget widget, EventHandler&amp;lt;ContextMenuEventArgs&amp;gt; handler) {&lt;/pre&gt;
&lt;pre&gt;            AttachToWidget(widget);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            ContextMenu += handler;&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; AttachToWidget(Widget widget) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            widget.PopupMenu += Widget_PopupMenu;&lt;/pre&gt;
&lt;pre&gt;            widget.ButtonPressEvent += Widget_ButtonPressEvent;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; DetachFromWidget(Widget widget) {&lt;/pre&gt;
&lt;pre&gt;            widget.PopupMenu -= Widget_PopupMenu;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            widget.ButtonPressEvent -= Widget_ButtonPressEvent;&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        [GLib.ConnectBefore]&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Widget_PopupMenu(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; o, PopupMenuArgs args) {&lt;/pre&gt;
&lt;pre&gt;            RaiseContextMenuEvent(args, (Widget)o, &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        [GLib.ConnectBefore]&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Widget_ButtonPressEvent(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; o, ButtonPressEventArgs args) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(args.Event.Button == 3 &amp;amp;&amp;amp; args.Event.Type == EventType.ButtonPress) {&lt;/pre&gt;
&lt;pre&gt;                RaiseContextMenuEvent(args, (Widget)o, &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            }&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; propagating = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;   &lt;span class=&quot;rem&quot;&gt;//Prevent reentry&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; RaiseContextMenuEvent(SignalArgs signalArgs, Widget widget, &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; rightClick) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(!propagating) {&lt;/pre&gt;
&lt;pre&gt;                &lt;span class=&quot;rem&quot;&gt;//Propagate the event&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                Event evnt = Gtk.Global.CurrentEvent;&lt;/pre&gt;
&lt;pre&gt;                propagating = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                Gtk.Global.PropagateEvent(widget, evnt);&lt;/pre&gt;
&lt;pre&gt;                propagating = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                signalArgs.RetVal = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;     &lt;span class=&quot;rem&quot;&gt;//The widget already processed the event in the propagation&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;rem&quot;&gt;//Raise the context menu event&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;                ContextMenuEventArgs args = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ContextMenuEventArgs(widget, rightClick);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(ContextMenu != &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;) {&lt;/pre&gt;
&lt;pre&gt;                    ContextMenu.Invoke(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;, args);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                }&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/5884370739242934263/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/menus-en-click-derecho-de-gkt-sharp.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/5884370739242934263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/5884370739242934263'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/menus-en-click-derecho-de-gkt-sharp.html' title='Menus en click derecho de Gkt sharp'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-3833461804251577328</id><published>2013-06-14T16:20:00.001-07:00</published><updated>2013-06-14T16:20:28.625-07:00</updated><title type='text'>Registro de errores y eventos con NLog</title><content type='html'>Es muy importante llevar un registro de eventos y errores en nuestras aplicaciones de .Net, de esta manera podemos encontrar y resolver problemas inesperados, en particular es muy útil en Asp.Net donde podemos configurar los reportes para enviar los errores por correo y percatarnos de problemas en tiempo real.&lt;br /&gt;
En el &lt;a href=&quot;http://nlog-project.org/&quot;&gt;sitio de NLog&lt;/a&gt; podemos descargar el instalador o las dlls de forma gratuita ya que el proyecto es open source, para la aplicación no es necesario usar el instalador solo hace falta incluir la dll en la carpeta de los binarios.&lt;br /&gt;
&lt;br /&gt;
Para desarrollar lo mas practico es usar el instalador ya que el mismo provee integración con visual studio, en nuestro proyecto elegimos añadir un nuevo archivo y escogemos un archivo de configuración de NLog, esto añadirá las referencias adecuadas y un archivo de ejemplo de configuracion de NLog.&lt;br /&gt;
&lt;br /&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/AVvXsEh0b2EyCVn8hzjmjvdDoXTFRjfDZJ-9Ruofkzvjc6-cQg_8LwGRQmGQLTW8tPff1LxX11qNsBcwLQ7Vr4txIE2zuMctsezBnFN0tMKurbbk7pl6A-prd87sEHSekzj3P4mKjiipNdcr688/s1600/Post.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0b2EyCVn8hzjmjvdDoXTFRjfDZJ-9Ruofkzvjc6-cQg_8LwGRQmGQLTW8tPff1LxX11qNsBcwLQ7Vr4txIE2zuMctsezBnFN0tMKurbbk7pl6A-prd87sEHSekzj3P4mKjiipNdcr688/s320/Post.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Después en las clases en las que queremos llevar un registro creamos un objeto estático de la clase Logger, la integración con Visual Studio incluye unos snipets, por que solo escribimos nlog presionamos tab dos veces y crea el código en automático:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger();&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Ahora para mandar un mensaje cualquiera tenemos varias funciones según el nivel de importancia con que queramos que aparezca el mensaje:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;logger.Info(&lt;span class=&quot;str&quot;&gt;&quot;Hola&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Este mensaje tiene un nivel de importancia solo informacional.&lt;br /&gt;
Una característica de NLog es que podemos mandar como parte del mensaje un excepción y según nuestra configuración el mensaje puede tener un nivel de información muy detallado incluyendo el momento, el stakctrace y cuanta información requiramos de la excepción:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;logger.FatalException(&lt;span class=&quot;str&quot;&gt;&quot;Error:&quot;&lt;/span&gt;, exception);&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Suficiente como introducción más adelante hablaremos de la configuración de NLog.</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/3833461804251577328/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/registro-de-errores-y-eventos-con-nlog.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3833461804251577328'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3833461804251577328'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/registro-de-errores-y-eventos-con-nlog.html' title='Registro de errores y eventos con NLog'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0b2EyCVn8hzjmjvdDoXTFRjfDZJ-9Ruofkzvjc6-cQg_8LwGRQmGQLTW8tPff1LxX11qNsBcwLQ7Vr4txIE2zuMctsezBnFN0tMKurbbk7pl6A-prd87sEHSekzj3P4mKjiipNdcr688/s72-c/Post.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-6138823186557490602</id><published>2013-06-13T15:50:00.003-07:00</published><updated>2013-06-13T15:51:45.423-07:00</updated><title type='text'>Obteniendo el tiempo desde la ultima actividad del usuario en Windows</title><content type='html'>El API de Windows nos proporciona una función para determinar el tiempo desde la ultima actividad del usuario: GetLastInputInfo.&lt;br /&gt;
Para usarla en .Net es necesario importarla desde la dll nativa user32.dll:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;[StructLayout(LayoutKind.Sequential)]&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;struct&lt;/span&gt; LASTINPUTINFO {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;readonly&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt; SizeOf = Marshal.SizeOf(&lt;span class=&quot;kwrd&quot;&gt;typeof&lt;/span&gt;(LASTINPUTINFO));&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    [MarshalAs(UnmanagedType.U4)]&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; UInt32 cbSize;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    [MarshalAs(UnmanagedType.U4)]&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; UInt32 dwTime;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;pre&gt;[DllImport(&lt;span class=&quot;str&quot;&gt;&quot;user32.dll&quot;&lt;/span&gt;)]&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;extern&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt; GetLastInputInfo(&lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; LASTINPUTINFO plii);&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
La función importada puede ser usada para obtener por ejemplo el total de minutos que ha estado inactiva la sesión, solo funciona para sesión en que fue llamada la función:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; GetLastInputTime() {&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;uint&lt;/span&gt; idleTime = 0;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    LASTINPUTINFO lastInputInfo = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; LASTINPUTINFO();&lt;/pre&gt;
&lt;pre&gt;    lastInputInfo.cbSize = (&lt;span class=&quot;kwrd&quot;&gt;uint&lt;/span&gt;)Marshal.SizeOf(lastInputInfo);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    lastInputInfo.dwTime = 0;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;uint&lt;/span&gt; envTicks = (&lt;span class=&quot;kwrd&quot;&gt;uint&lt;/span&gt;)Environment.TickCount;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;if&lt;/span&gt;(GetLastInputInfo(&lt;span class=&quot;kwrd&quot;&gt;ref&lt;/span&gt; lastInputInfo)) {&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;uint&lt;/span&gt; lastInputTick = lastInputInfo.dwTime;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        idleTime = envTicks - lastInputTick;&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    TimeSpan span = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; TimeSpan(0, 0, 0, 0, (&lt;span class=&quot;kwrd&quot;&gt;int&lt;/span&gt;)idleTime);&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; span.TotalMinutes;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Hasta la próxima!</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/6138823186557490602/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/obteniendo-el-tiempo-desde-la-ultima.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6138823186557490602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6138823186557490602'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/obteniendo-el-tiempo-desde-la-ultima.html' title='Obteniendo el tiempo desde la ultima actividad del usuario en Windows'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-7679611023560963908</id><published>2013-06-11T16:45:00.002-07:00</published><updated>2013-06-11T16:45:24.120-07:00</updated><title type='text'>Cambiar de tamaño automaticamente la imagen de un Gtk.Image</title><content type='html'>A continuación les pongo el código de una clase que cambia estomáticamente el tamaño de un Gtk.Image al crear o cambiar el tamaño del objeto, es decir el equivalente a la propiedad zoom de un PictureBox de Windows.Forms.&lt;br /&gt;
El proceso es captar el evento expose que ocurre al cambiar de tamaño del objeto y ahí escalar la imagen usando la clase Gdk.Pixbuf para mantener la proporción de la imagen se crea el objeto dentro de un AspectFrame.&lt;br /&gt;
&lt;br /&gt;
El código:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gtk;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gdk;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; Test {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;internal&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; ImageResize {&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Gtk.Image _Wrapped = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; Pixbuf original = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; _File = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; ImageResize(Gtk.Image wrapped) {&lt;/pre&gt;
&lt;pre&gt;            _Wrapped = wrapped;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            _Wrapped.ExposeEvent += &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ExposeEventHandler(ImageResize_ExposeEvent);&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; ImageResize_ExposeEvent(&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; o, ExposeEventArgs args) {&lt;/pre&gt;
&lt;pre&gt;            Pixbuf newPix = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Pixbuf(original.Colorspace, original.HasAlpha, original.BitsPerSample, _Wrapped.Allocation.Width, _Wrapped.Allocation.Height);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt; zoom = (&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)((&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)_Wrapped.Allocation.Width / (&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)((&lt;span class=&quot;kwrd&quot;&gt;double&lt;/span&gt;)original.Width));&lt;/pre&gt;
&lt;pre&gt;            original.Scale(newPix, 0, 0, _Wrapped.Allocation.Width, _Wrapped.Allocation.Height, 0, 0, zoom, zoom, InterpType.Nearest);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            _Wrapped.Pixbuf = newPix;&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; File {&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt; {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; _File;&lt;/pre&gt;
&lt;pre&gt;            }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;                _File = value;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                original = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Pixbuf(_File);&lt;/pre&gt;
&lt;pre&gt;                ImageResize_ExposeEvent(&lt;span class=&quot;kwrd&quot;&gt;this&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            }&lt;/pre&gt;
&lt;pre&gt;        }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    }&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/7679611023560963908/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/cambiar-de-tamano-automaticamente-la.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7679611023560963908'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7679611023560963908'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/cambiar-de-tamano-automaticamente-la.html' title='Cambiar de tamaño automaticamente la imagen de un Gtk.Image'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-8990290068810200646</id><published>2013-06-08T18:31:00.005-07:00</published><updated>2013-06-08T18:31:46.420-07:00</updated><title type='text'>Creación de eventos en c#</title><content type='html'>En c# hay varias formas de declarar un evento cada una de diferente complejidad según lo que queramos hacer, lo forma mas simple es marcar el miembro con la palabra clave event y de tipo que sea una de las múltiples clases que hay para manejar eventos puede ser interconstruida o propia de la aplicación.&lt;br /&gt;
Como vemos en el siguiente ejemplo también debemos declarar las clases para los argumentos si queremos pasar un valor especial al evento. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;event&lt;/span&gt; MyEventHandler PropertyChanged;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;delegate&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; MyEventHandler(Object sender&lt;/pre&gt;
&lt;pre&gt;        , MyEventArgs e);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MyEventArgs&lt;/pre&gt;
&lt;pre&gt;        : System.ComponentModel.PropertyChangedEventArgs {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; Value { &lt;span class=&quot;kwrd&quot;&gt;get&lt;/span&gt;; &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;set&lt;/span&gt;; }&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; MyEventArgs(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; propertyName, &lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; value)&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            : &lt;span class=&quot;kwrd&quot;&gt;base&lt;/span&gt;(propertyName) {&lt;/pre&gt;
&lt;pre&gt;            Value = value;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Las otras formas de declarar eventos son para casos mas complejos como &quot;eventos read only&quot; y por lo general no se usan.</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/8990290068810200646/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/creacion-de-eventos-en-c.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/8990290068810200646'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/8990290068810200646'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/creacion-de-eventos-en-c.html' title='Creación de eventos en c#'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-1845764629741181539</id><published>2013-06-07T18:16:00.001-07:00</published><updated>2013-06-07T18:16:18.330-07:00</updated><title type='text'>Ejecutar programas desde .Net Framework</title><content type='html'>La funcionalidad para ejecutar un programa desde .Net Framework se encuentra en el espacio de nombres System.Diagnostics y es a través de las clases Process y ProcessStartInfo.&lt;br /&gt;
La clase Process representa un programa en ejecución y ProcessStartInfo los parámetros con que se ejecuta el proceso entre otros: el nombre del programa, si se redirecciona la entrada y salida estándar, si se va a crear una ventana para el programa, el directorio de trabajo etc.&lt;br /&gt;
La forma en que se crea un proceso es usar el método&amp;nbsp; Start de la clase Process, ya sea el miembro estático con alguna de sus sobrecargas, para crear un nuevo objeto, o el miembro de instancia para usar un objeto construido previamente.&lt;br /&gt;
Las diferente sobrecargas nos sirven para ejecutar un programa indicando sus opciones directamente o usando un ProcessStartInfo para indicarlas, esta opción es la que nos permite mas flexibilidad.&lt;br /&gt;
En particular la opción&amp;nbsp; UseShellExecute es ideal para programas de linea de comandos.&lt;br /&gt;
&lt;br /&gt;
A continuación el ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System.Diagnostics;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; Class1&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;{&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; StarP() {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        ProcessStartInfo stInfo = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ProcessStartInfo(&lt;span class=&quot;str&quot;&gt;&quot;prog.exe&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;        stInfo.UseShellExecute = &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        Process proc = Process.Start(stInfo);&lt;/pre&gt;
&lt;pre&gt;        proc.WaitForExit();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    }&lt;/pre&gt;
&lt;pre&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/1845764629741181539/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/ejecutar-programas-desde-net-framework.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/1845764629741181539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/1845764629741181539'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/ejecutar-programas-desde-net-framework.html' title='Ejecutar programas desde .Net Framework'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-117617271172021894</id><published>2013-06-06T18:59:00.002-07:00</published><updated>2013-06-06T18:59:28.691-07:00</updated><title type='text'>Gestionar excepciones de manera global en Asp.Net</title><content type='html'>Asp.Net tiene una forma de pescar cualquier excepción que ocurra en el sitio de forma centralizada.&lt;br /&gt;
En efecto lo único que tenemos que hacer es implementar el metodo Application_Error del archivo Global.asax en un sitio web y este se ejecutara cada vez que ocurra una excepción no controlada en la aplicación.&lt;br /&gt;
La excepción que ocurrió esta disponible accesando la función Server.GetLastError().&lt;br /&gt;
Por ejemplo podemos capturar la excepción y reportarla usando nlog, mandarla por email, etc. </content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/117617271172021894/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/gestionar-excepciones-de-manera-global.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/117617271172021894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/117617271172021894'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/gestionar-excepciones-de-manera-global.html' title='Gestionar excepciones de manera global en Asp.Net'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-2717644728131605097</id><published>2013-06-03T14:06:00.001-07:00</published><updated>2013-06-03T14:06:06.035-07:00</updated><title type='text'>Agregar Web Services en Visual Studio 2008 en adelante</title><content type='html'>En las versiones mas recientes de Visual Studio no se tiene la opción directa para añadir Web Services al proyecto, lo que se tiene es la opción de agregar referencias de servicios, estos servicios son los creados con WCF y aunque se puede usar un Web Service antiguo con WCF en ocasiones podemos necesitar un Web Service sin usar WPF por ejemplo si no queremos incluir la referencia a esos componentes en el proyecto.&lt;br /&gt;
En estos casos podemos incluir el Web Service siguiendo estos pasos.&lt;br /&gt;
Se selecciona agregar referencia de servicio como si fuéramos a agregar un servicio WCF.&lt;br /&gt;
En esta ventana seleccionamos el botón &quot;Avanzadas...&quot;&lt;br /&gt;
&lt;br /&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/AVvXsEi6y4X5tmzPe1o7ln4JNeEj8Q9sundLjEZZTjz5DSNKMsATncNYvKWA4434hb5p6eWg7djg-OeacPGelMgGnT2gru2Fl20jjS8r8h06Z_imnWwdQ67zA7jXcCKUYa1_z0M1xgUgBz84Np0/s1600/uno.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;287&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6y4X5tmzPe1o7ln4JNeEj8Q9sundLjEZZTjz5DSNKMsATncNYvKWA4434hb5p6eWg7djg-OeacPGelMgGnT2gru2Fl20jjS8r8h06Z_imnWwdQ67zA7jXcCKUYa1_z0M1xgUgBz84Np0/s320/uno.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
En la ventana que aparece seleccionamos &quot;Agregar referencia web...&quot;&lt;br /&gt;
&lt;br /&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/AVvXsEgqut9v1AM9NP3T-UmhQdrO-ftG0q1M8CLLf5IzokRX354gXkGUhzvFtlcv2vePisA1AQxpngZgmvIJ1tzq1AiJBzar69oFA-rX8-cHtE6wSlFGmxKJSBBLWVuDRDR-0VPjxJcD8Pbkkj8/s1600/dos.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqut9v1AM9NP3T-UmhQdrO-ftG0q1M8CLLf5IzokRX354gXkGUhzvFtlcv2vePisA1AQxpngZgmvIJ1tzq1AiJBzar69oFA-rX8-cHtE6wSlFGmxKJSBBLWVuDRDR-0VPjxJcD8Pbkkj8/s320/dos.jpg&quot; width=&quot;309&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Y finalmente nos aparece la pantalla para agregar un Web Service &quot;clásico&quot;&lt;br /&gt;
&lt;br /&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/AVvXsEhkgElBNDvHTm20AVEbcbJrTb6KGtJQ72U6WBAigYg0EaIQ3R1v-kmFKgHtefOhfEGSLOs3oePAQuzV6UJEdUebX1w972P-DSl4iTj7ezAE0vZZxWbK3WhalGmLMEPmB8c5akHl0PiMCng/s1600/tres.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;246&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkgElBNDvHTm20AVEbcbJrTb6KGtJQ72U6WBAigYg0EaIQ3R1v-kmFKgHtefOhfEGSLOs3oePAQuzV6UJEdUebX1w972P-DSl4iTj7ezAE0vZZxWbK3WhalGmLMEPmB8c5akHl0PiMCng/s320/tres.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/2717644728131605097/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/agregar-web-services-en-visual-studio.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2717644728131605097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2717644728131605097'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/agregar-web-services-en-visual-studio.html' title='Agregar Web Services en Visual Studio 2008 en adelante'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi6y4X5tmzPe1o7ln4JNeEj8Q9sundLjEZZTjz5DSNKMsATncNYvKWA4434hb5p6eWg7djg-OeacPGelMgGnT2gru2Fl20jjS8r8h06Z_imnWwdQ67zA7jXcCKUYa1_z0M1xgUgBz84Np0/s72-c/uno.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-6241644843837739045</id><published>2013-06-02T19:02:00.001-07:00</published><updated>2013-06-02T19:03:26.073-07:00</updated><title type='text'>Obteniendo el texto de un PDF en .Net</title><content type='html'>PdfBox es una librería que permite entre otras cosas obtener el texto de un pdf, este software es para java pero se puede usar en gracias a IKVM que permite convertir archivos de java en dlls.&lt;br /&gt;
&lt;br /&gt;
El ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; org.pdfbox.pdmodel;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; org.pdfbox.util;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; GetText() {&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; Retrieve(&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt; fileName) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        PDDocument doc = PDDocument.load(fileName);&lt;/pre&gt;
&lt;pre&gt;        PDFTextStripper stripper = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; PDFTextStripper();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; stripper.getText(doc);&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
PDFBox se puede obtener en esta página: &lt;a href=&quot;http://www.squarepdf.net/pdfbox-in-net/&quot;&gt;http://www.squarepdf.net/pdfbox-in-net/&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/6241644843837739045/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/obteniendo-el-texto-de-un-pdf-en-net.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6241644843837739045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6241644843837739045'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/obteniendo-el-texto-de-un-pdf-en-net.html' title='Obteniendo el texto de un PDF en .Net'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-6734424235237022233</id><published>2013-06-01T16:31:00.002-07:00</published><updated>2013-06-01T16:31:51.783-07:00</updated><title type='text'>Gtk Builder en .Net</title><content type='html'>Gtk Builder es la forma mas moderna de crear interfaces en gtk por medio de un editor WYSIWYG, es mas completo que stetic y el editor no truena en cada paso.&lt;br /&gt;
Es posible usar GTK.Builder en proyectos .Net o Mono pero la documentación es practicamente inexistente de hecho yo aprendi a usarlo en un sitio de Python pues como siempre la gente de mono tiene el proyecto completamente descuidado.&lt;br /&gt;
Lo básico es crear el objeto cargar el archivo xml que creamos con el programa Glade (que también funciona en Windows) obtener la ventana que queremos usar y mostrarla, es mejor crear una ventana por archivo pues despues nos puede dar problemas encontrar objetos con el mismo identificador.&lt;br /&gt;
Tambien debemos escribir un poco de código para poder usar los objetos que contiene el archivo ya que no hay forma de cargarlos automaticamente, solo buscamos el objeto dentro del Builder y lo asignamos a una variable de la clase.&lt;br /&gt;
Para las señales (eventos) lo mejor es usar las referencias que encontramos en el paso anterior y asignar los eventos directamente ya que aunque hay una función para conectar los eventos es complicada y de todos modos ya tenemos las referencias así que es más facil hacerlo de esta manera.&lt;br /&gt;
A continuación el codigo de ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1.0&quot;&lt;/span&gt;?&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;interface&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;  &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;requires&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;lib&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;gtk+&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;2.16&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class=&quot;rem&quot;&gt;&amp;lt;!-- interface-naming-policy toplevel-contextual --&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;  &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;GtkWindow&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;window1&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;      &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;GtkVBox&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;vbox1&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;visible&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;True&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;orientation&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;vertical&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;GtkLabel&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;label1&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;visible&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;True&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;xalign&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;0&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;label&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;translatable&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;yes&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;label&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;packing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;expand&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;False&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;fill&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;False&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;position&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;0&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;packing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;GtkButton&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;button1&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;label&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;translatable&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;yes&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;button&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;visible&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;True&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;can_focus&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;True&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;receives_default&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;True&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;yalign&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;0&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;packing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;expand&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;False&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;fill&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;False&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;position&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;1&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;property&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;          &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;packing&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;      &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;child&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;  &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;object&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;interface&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;/div&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;using&lt;/span&gt; Gtk;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;namespace&lt;/span&gt; GTKBuilder {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;class&lt;/span&gt; MainClass {&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        Window thisWnd = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;        Builder thisObject = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        Button button1 = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre&gt;        Label label1 = &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Main (&lt;span class=&quot;kwrd&quot;&gt;string&lt;/span&gt;[] args) {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            Application.Init ();&lt;/pre&gt;
&lt;pre&gt;            MainClass tester = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MainClass();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            tester.Show();&lt;/pre&gt;
&lt;pre&gt;            Application.Run ();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        MainClass() {&lt;/pre&gt;
&lt;pre&gt;            InitializeComponent();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; InitializeComponent(){&lt;/pre&gt;
&lt;pre&gt;            thisObject = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; Gtk.Builder();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            thisObject.AddFromFile(&lt;span class=&quot;str&quot;&gt;&quot;tester.glade&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            thisWnd = (Window)thisObject.GetObject(&lt;span class=&quot;str&quot;&gt;&quot;window1&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            label1 = (Label)thisObject.GetObject(&lt;span class=&quot;str&quot;&gt;&quot;label1&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;            button1 = (Button)thisObject.GetObject(&lt;span class=&quot;str&quot;&gt;&quot;button1&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            button1.Clicked += (&lt;span class=&quot;kwrd&quot;&gt;object&lt;/span&gt; sender, EventArgs e) =&amp;gt; {&lt;/pre&gt;
&lt;pre&gt;                label1.Text = &lt;span class=&quot;str&quot;&gt;&quot;Hello&quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            };&lt;/pre&gt;
&lt;pre&gt;            thisWnd.DeleteEvent += (o, args) =&amp;gt; {&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                Application.Quit();&lt;/pre&gt;
&lt;pre&gt;            };&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Show() {&lt;/pre&gt;
&lt;pre&gt;            thisWnd.ShowAll();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        }&lt;/pre&gt;
&lt;pre&gt;    }&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;}&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/6734424235237022233/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/06/gtk-builder-en-net.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6734424235237022233'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/6734424235237022233'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/06/gtk-builder-en-net.html' title='Gtk Builder en .Net'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-3844978121149284433</id><published>2013-05-27T13:11:00.001-07:00</published><updated>2013-05-27T13:11:43.674-07:00</updated><title type='text'>Mandar correos desde .Net Framework</title><content type='html'>En .Net Framework es posible mandar correos usando la clase SmtpClient esta funcionalidad se encuentra en los espacios de nombre System.Net y System.Net.Mail, se pueden mandar correos en formato de texto o html e incluir archivos adjuntos, es muy sencillo, a continuación el ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; SendMail() {
    SmtpClient sender = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; SmtpClient(&lt;span class=&quot;str&quot;&gt;&quot;127.0.0.1&quot;&lt;/span&gt;, 25);
    sender.Credentials = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; NetworkCredential(&lt;span class=&quot;str&quot;&gt;&quot;usr&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;Password&quot;&lt;/span&gt;);
    MailMessage message = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; MailMessage(&lt;span class=&quot;str&quot;&gt;&quot;from@localhost&quot;&lt;/span&gt;, &lt;span class=&quot;str&quot;&gt;&quot;to@localhost&quot;&lt;/span&gt;);
    message.Subject = &lt;span class=&quot;str&quot;&gt;&quot;Mail test&quot;&lt;/span&gt;;
    message.Body = &lt;span class=&quot;str&quot;&gt;&quot;This is a test&quot;&lt;/span&gt;;
    message.IsBodyHtml = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;
    mailer.Send(message);
}&lt;/pre&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;&lt;/pre&gt;
Hasta la proxima!</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/3844978121149284433/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/05/mandar-correos-desde-net-framework.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3844978121149284433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/3844978121149284433'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/05/mandar-correos-desde-net-framework.html' title='Mandar correos desde .Net Framework'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-8703320883926135395</id><published>2013-05-26T13:46:00.004-07:00</published><updated>2013-05-26T13:46:54.616-07:00</updated><title type='text'>Obtener la localización de usuarios web con GeoIP</title><content type='html'>En .Net tenemos la posibilidad de obtener la localización  de nuestros usuarios usando las bases de datos y clases que proporciona &lt;a href=&quot;http://dev.maxmind.com/geoip/legacy/geolite&quot;&gt;MaxMind de manera gratuita&lt;/a&gt;, hay dos versiones de las bases de datos, para localizar el país, y para encontrar datos hasta el nivel de ciudad, las diferencia es que la base de datos de países es mucho mas pequeña pero en la versión de ciudades también podemos obtener también el país pero además la zona, la ciudad el código postal y otros datos.&lt;br /&gt;
Para usarla hay que copiar el archivo de datos a una carpeta accesible por nuestra aplicación, instanciar la clase LookupService y llamar sus métodos basandonos siempre en la ip del cliente.&lt;br /&gt;
La única inconveniencia es que las clases no vienen en formato binario, pero es cuestión de minutos compilarlas y añadirlas a nuestros proyectos.&lt;br /&gt;
A continuación un ejemplo muy simplificado de su uso en Asp.Net:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;pre class=&quot;csharpcode&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;void&lt;/span&gt; Detect() {
    LookupService ls
        = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; LookupService(Server.MapPath(&lt;span class=&quot;str&quot;&gt;&quot;/GeoLiteCity.dat&quot;&lt;/span&gt;)
        , LookupService.GEOIP_STANDARD);
    Location loc
        = ls.getLocation(Request.UserHostAddress);
    Response.Write(loc.regionName);
}&lt;/pre&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/8703320883926135395/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/05/obtener-la-localizacion-de-usuarios-web.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/8703320883926135395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/8703320883926135395'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/05/obtener-la-localizacion-de-usuarios-web.html' title='Obtener la localización de usuarios web con GeoIP'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-4910237618070787289</id><published>2013-05-25T16:41:00.001-07:00</published><updated>2013-05-26T13:27:20.240-07:00</updated><title type='text'>Trucos de rendimiento en linq</title><content type='html'>Usar linq es muy tentador por la forma en que hace fácil escribir código sobre colecciones de valores ya sea en objetos, xml, sql o cualquier otra forma de agrupar valores, sin embargo hay que tener mucho cuidado con su uso ya que podemos caer en trampas que hacen el código muy lento, por ejemplo: en linq a objetos es muy fácil crear una expresión que busque un objeto con un determinado valor en una propiedad, sin embargo la trampa es que linq recorre toda la colección y compara objeto por objeto con el valor buscado, en colecciones pequeñas esto no es un problema pero si manejas un número de objetos significativo tu programa se puede alentar bastante, una posible solución es usar un árbol e indizarlo usando la propiedad que vas a buscar con lo que el rendimiento puede mejorarse incluso en varios de magnitud.&lt;br /&gt;
Otro ejemplo linq a xml, en este caso el problema es que el xml se almacena por completo en memoria, siendo una vez mas un problema con archivos grandes que nos pueden usar hasta gigabytes de memoria para archivos de solo unos megas, en estos casos puede convenir mas usar el xmlreader que lee los elementos uno por uno desde el stream y luego los descarta usando por lo tanto poquísima memoria.&lt;br /&gt;
&lt;br /&gt;
Por supuesto las necesidades de cada programa varían y puedes encontrarte en que no tengas otra solución que usar linq.</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/4910237618070787289/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/05/trucos-de-rendimiento-en-linq.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4910237618070787289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4910237618070787289'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/05/trucos-de-rendimiento-en-linq.html' title='Trucos de rendimiento en linq'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-2632357204715688416</id><published>2013-02-07T14:49:00.002-08:00</published><updated>2013-02-07T14:49:43.637-08:00</updated><title type='text'>Mostrando ayuda chm en Windows Forms</title><content type='html'>En windows forms hay una clase especial para mostrar ayuda desde archivos chm para nuestra aplicación esta clase es System.Windows.Forms.Help y es una clase estatica muy fácil de usar basta llamar a uno de los métodos ShowHelp con los parámetros adecuados es decir la dirección del archivo y opcionalmente una dirección de navegación que nos mostrara la ayuda en la posición adecuada.&lt;br /&gt;
Para mostrar la ayuda en su inicio:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Help.ShowHelp(this, &quot;Desktop.chm&quot;);&lt;br /&gt;
&lt;br /&gt;
Y para mostrarla en la pestaña de busqueda (sin palabra clave indicada):&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;Help.ShowHelp(this, &quot;Desktop.chm&quot;, HelpNavigator.Find, &quot;&quot;);</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/2632357204715688416/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/02/mostrando-ayuda-chm-en-windows-forms.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2632357204715688416'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/2632357204715688416'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/02/mostrando-ayuda-chm-en-windows-forms.html' title='Mostrando ayuda chm en Windows Forms'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-7820807207956268331</id><published>2013-01-31T16:31:00.001-08:00</published><updated>2013-02-07T14:43:38.639-08:00</updated><title type='text'>Usando c# en xslt</title><content type='html'>En .Net el soporte de xslt se limita a la version 1 y no parece que esto vaya a cambiar pronto asi que estamos muy limitados en cuanto a lo que se puede hacer: hay pocas funciones y no se pueden declarar funciones nuevas.&lt;br /&gt;
Afortunadamente Microsoft incluyo soporte para crear funciones nuevas funciones en cualquier lenguaje de .Net esto es a través del elemento&lt;tt&gt; &lt;/tt&gt;&amp;lt;msxsl:script /&amp;gt;&lt;br /&gt;
En el ejemplo creamos la función Trim que no tiene equivalente en xslt (aunque normalize-space se parece)&lt;br /&gt;
Hay que recordar que esto solo se soporta en m$, si vas a usar tu xslt con otras aplicaciones no va a funcionar.&lt;br /&gt;
Para activarlo con la clase&amp;nbsp; XslCompiledTransform se debe cargar el xslt con un objecto XsltSettings con la propiedad EnableScript en true:&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;XsltSettings xsltSettings = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; XsltSettings();&lt;/pre&gt;
&lt;pre&gt;xsltSettings.EnableScript = &lt;span class=&quot;kwrd&quot;&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;XslCompiledTransform transform = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; XslCompiledTransform(&lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;transform.Load(styleSheet, xsltSettings, &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; XmlUrlResolver());&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;

&lt;br /&gt;
&lt;div class=&quot;csharpcode&quot;&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xml&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1.0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;encoding&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;utf-8&quot;&lt;/span&gt;?&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:stylesheet&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;1.0&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;xmlns:xsl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;http://www.w3.org/1999/XSL/Transform&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;attr&quot;&gt;xmlns:msxsl&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;urn:schemas-microsoft-com:xslt&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;attr&quot;&gt;exclude-result-prefixes&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;msxsl&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;attr&quot;&gt;xmlns:user&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;urn:my-scripts&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;msxsl:script&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;C#&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;implements-prefix&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;user&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;!&lt;/span&gt;[CDATA[&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            public string Trim(string input) {&lt;/pre&gt;
&lt;pre&gt;                return input.Trim();&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;            }&lt;/pre&gt;
&lt;pre&gt;        ]]&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;msxsl:script&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:output&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;xml&quot;&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;indent&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;yes&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:template&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;match&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;/&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;NewRoot&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:for-each&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;OldValues/OldValue&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;NewValue&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:value-of&lt;/span&gt; &lt;span class=&quot;attr&quot;&gt;select&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;=&quot;user:Trim(Id)&quot;&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;                    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;Id&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;                &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;NewValue&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;            &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:for-each&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;        &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;NewRoot&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;    &lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:template&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;alt&quot;&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;html&quot;&gt;xsl:stylesheet&lt;/span&gt;&lt;span class=&quot;kwrd&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/7820807207956268331/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2013/01/usando-c-en-xslt.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7820807207956268331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/7820807207956268331'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2013/01/usando-c-en-xslt.html' title='Usando c# en xslt'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7405922360324420417.post-4959562870638881531</id><published>2012-06-17T15:26:00.002-07:00</published><updated>2012-06-17T15:27:59.599-07:00</updated><title type='text'>Delegados anonimos asincronos</title><content type='html'>El titulo lo dice todo aquí esta el ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;Func&amp;lt;&lt;span class=&quot;kwrd&quot;&gt;bool&lt;/span&gt;&amp;gt; async = () =&amp;gt; {
    &lt;span class=&quot;kwrd&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;kwrd&quot;&gt;false&lt;/span&gt;;
};
IAsyncResult res = async.BeginInvoke(&lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;, &lt;span class=&quot;kwrd&quot;&gt;null&lt;/span&gt;);
async.EndInvoke(res);&lt;/pre&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;&amp;nbsp;&lt;/pre&gt;
Lo único que hay que resaltar es que en el ejemplo use una función que retorna un bool como se observa claramente pero se pueden usar las diferentes variantes de Func y Action para cambiar los parámetros y resultados.</content><link rel='replies' type='application/atom+xml' href='http://solonetframework.blogspot.com/feeds/4959562870638881531/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://solonetframework.blogspot.com/2012/06/delegados-anonimos-asincronos.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4959562870638881531'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7405922360324420417/posts/default/4959562870638881531'/><link rel='alternate' type='text/html' href='http://solonetframework.blogspot.com/2012/06/delegados-anonimos-asincronos.html' title='Delegados anonimos asincronos'/><author><name>Marcos Israel Ibarra Arias</name><uri>http://www.blogger.com/profile/03352634911156408638</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>