Browse by Tags

All Tags » Code   (RSS)
Everyone knows how to open a file from code. Let’s say we have an executable file and we want to use C# to open it. All we have to do is to use the Process.Start(string argument) method like this: Process .Start( @"c:/sample.exe" ); By running this, the Read More...
Posted 27 februarie 2009 20:51 by lucianb | 0 Comments
Filed under:
Sometimes you need to set all values of an array to a default value. You can do this with a "for" loop that sets every value in the array to the default value you need. I will show you how to do this using extension methods and generics. See the next Read More...
Posted 27 octombrie 2008 11:10 by lucianb | 1 Comments
Filed under:
Deşi tema a mai fost abordată (şi chiar pe acest board ), aş vrea să punctez şi eu (poate cu o prea mare întârziere) existenţa unei modalităţi în C# 3.0 de a extinde funcţionalitatea unei clase. Ce mi se pare cu adevărat interesant ( şi nu văd punctat Read More...
Posted 7 august 2008 23:52 by lucianb | 6 Comments
Filed under:
Have you ever used the Wikipedia’s Special Export Function ? It lets you get the text of an Wikipedia article and use it for your own purposes. Well, I did. You can read about how to do this here . I was complaining back then that I have no way to translate Read More...
To check if the FTP Server is on, use the following snippet: public void ConnectFtpSite( string host, int port) { try { Socket s = new Socket ( AddressFamily .InterNetwork, SocketType .Stream, ProtocolType .Tcp); IPHostEntry iphost = Dns .GetHostByName(host); Read More...
Posted 23 iunie 2008 13:08 by lucianb | 0 Comments
Filed under:
If you want to check if a HTTP server is active on a machine on your network, the following code snippet might be useful: string server = "127.0.0.1" ; // The default HTTP Port. This can be changed int port = 80; string page = "" ; // The command sent Read More...
Posted 22 iunie 2008 16:52 by lucianb | 0 Comments
Filed under:
If you need to verify if a computer from the network is online and you know it's IP address, you can achieve this using the following code: string server = "xxx.xxx.xxx.xxx" ; //address to verify, like 127.0.0.1 IPAddress ipa = IPAddress .Parse(server); Read More...
Posted 21 iunie 2008 15:31 by lucianb | 10 Comments
Filed under:
A simple way of creating XML documents based on actual objects is to use the XmlSerializer class. I'll just write a simple sample of how to do this. More complex documents can be created, but the idea behind this article is to get you started. So let's Read More...
Posted 7 mai 2008 18:42 by lucianb | 3 Comments
Filed under:
A few months ago, as I was implementing my Question Answering System for the Romanian Language , I needed a way to interrogate a search engine. As I am using Google, I decided to do a Get WebRequest on the Google page corresponding to the topic I had Read More...
Posted 29 ianuarie 2008 10:22 by lucianb | 5 Comments
Filed under:
Sau cout<<x<<endl; dacă preferaţi. Care e valoarea lui x după: int x = 10; x=x++-++x+--x+x--; şi de ce? Technorati tags: Fun , Code Read More...
Posted 29 decembrie 2007 18:52 by lucianb | 21 Comments
Filed under: ,
Zilele trecute am fost rugat de o colegă să îi spun cum poate extinde capabilităţile unui buton cu imagine (ImageButton) din ASP.NET astfel încât să îşi schimbe imaginea atunci când mouseul este poziţionat pe buton. Când mouseul este mutat de pe buton, Read More...
Cand am vazut asta , mi-am dat seama ca merita evanghelizare! Am descoperit limbajul viitorului! Limbajul care va detrona C++, Java, C#. Va fi mai in voga si decat Ruby! Daca nu ma credeti, uitati-va putin pe sintaxa ! E pur si simplu minunata! Siteul Read More...
I had some hard time today as I was trying to migrate a database from MySQL 5.0 to MSSQL Server 2005 Express Edition. First I’ve tried some “free” migration tools. After installation, the programs asked for an activation key, which could be purchased Read More...
I’m planning for some time to write an article about Windows Vista SideShow. I was busy lately (actualy I still am) so I’ll just write a few introductory stuff, to get you started. I assume you know what Vista SideShow is. If you don’t know, maybe you Read More...
Maybe you’ve read my article about Windows Vista Sidebar , found it interesting, and after that you’ve tried to follow the steps described in the article to create your own gadget. I admit that the result might seem a little too unspectacular. The gadget Read More...
I know, this may seem like a simple task, and you will probably find references on the web about how to do this. But I’ll also write a blog post on this topic, as I came across this problem today. So, if you have a PDF file and don’t know how to read Read More...
Posted 22 martie 2007 23:35 by lucianb | 154 Comments
Filed under:
Maybe someday you'll find yourself in a position where you'll have to use in your application some data from an encyclopedia, and the data will have to be retrieved programmatically. Giving the fact that the largest online encyclopedia is a good (and Read More...
So now that you’ve installed the new Windows Vista on your machine and took it to a quick ride, I’m sure you’ve noticed the nice toolbar in the right side of the screen. It is called the Windows Vista Sidebar and it is meant to host a series of gadgets. Read More...
Ca o continuare la problemele propuse de Mircea , va pun si eu o intrebare legata de un cod. Deci se da urmatorul cod: using System; class Test { unsafe static void F( ref int * pi1) { int i = 10; pi1 = &i; } static void Main() { int i = 10; unsafe Read More...
Posted 22 martie 2006 17:17 by admin | 4 Comments
Filed under: