Tip: List of all ports used by Windows Services

For a complete list of all possible ports used by Windows Services, check this nice article for KB support:

http://support.microsoft.com/kb/832017/en-us

 

 

Posted in VB.Net. Tags: . Leave a Comment »

Simplest ever example for Log4Net and VB.NET

When reading the log4net manual I figured out even more simpler way to put logging in VB.Net applications.

All you have to do:

  • Add reference to log4net.dll
  • Add imports for log4net and log4net.Config namespaces (either in project level or in each Class file in your app)
  • Call once of the log4net’s BasicConfigurator class ‘Configure’ method in your main Class.
  • Create logger instance in each of your Classes

With this solution you’ll get quicky started on logging, and it has following advantages:

  • You don’t need to create and configure .config file at all
  • You don’t have to open the log file to see what is happening there as you can use Vs.NET “Output window” instead (but you don’t have to spend time configuring it either !)
  • You’ll get the class name automatically printed into messages.

Read the rest of this entry »

Posted in Tips, VB.Net. Tags: , . 7 Comments »

Simple Log4Net example with VB.Net

Since I couldn’t find easily startup example for log4net written in VB.Net, I decided to write one for myself. In this example I’m using my favorite appender, the RollingFileAppender  that has fixed file size and one automatic backup.

See also:
  1. http://vpalmu.wordpress.com/2007/09/27/simplest-ever-example-for-log4net-and-vbnet/
  2. http://vpalmu.wordpress.com/2007/08/30/log4net-and-filename-com1txt/

Please download and install the last version of the log4net if you haven’t already done it. Create new windows application project.With VS2005 open, choose “File”, “New Project”. On New Project Window, choose “Windows application”,type “Log4NetApp” in the “Name” field, click ok. Open the Form1.vb, create five command buttons

  1. “Debug”
  2. “Info”
  3. “Warn”
  4. “Error”
  5. “Fatal” Read the rest of this entry »
Follow

Get every new post delivered to your Inbox.