Singleton Design Pattern in Java

When we write java applications, sometimes it is appropriate to have only one instance of a class. Windows Managers, Login and Dialog boxes etc are few examples of such classes. The Singleton design pattern solves this common problem and ensures that the class has only one instance. This also provides global point of access to the object.

Read Full Tutorial

Send Emails in ASP.NET 2.0 with Authentication

Sending emails from ASP.NET 2.0 application is made very simply using MailMessage and SmtpClient classes available in System.Net.Mail namespace in .NET Framework. Sometimes SMTP server required authentication information of email client to send emails. In the following tutorial, I will show you how you can authenticate smtp client when sending emails in ASP.NET 2.0.

Read Full Tutorial

Sending Plain Text Email in ASP.NET 2.0

.NET Framework namespace System.Net.Mail contains many classes developers can use to send all types of emails in ASP.NET 2.0. In the following tutorial I will show you how you can send a simple plain text email in ASP.NET 2.0.

Read Full Tutorial

Application Configuration Settings in .NET

Saving and restoring application settings outside source code is crucial part of any software application. .NET Framework provides very simple solution for saving application settings in .config files. Framework also provides classes to read these settings in .NET application in a very easy way. In the following tutorial, I will show you how you can store and retrieve application settings stored in App.config file in .NET windows application using C#.

Read Full Tutorial

Storing Database Connection Strings in App.Config

Storing database connection strings in source code can lead you to some security issues and can also cause you maintenance problems. It is always recommended that you keep your connection strings in a separate configuration file so that you can change database connection related information such as password or database name without even modifying or recompiling your source code.

Read Full Tutorial

Copying Text based Files in Java

Java IO Package provides two streams we can use to read and write all types of files including images, audio, video or even text files. These classes are FileInputStream and FileOutputStream. In the following tutorial, I will show you how you can use these classes to read and write image file.

Read Full Tutorial

Posted in Java. Tags: . Leave a Comment »

Writing Text Files in Java using FileWriter class

Java IO package provides FileWriter class which developers can use to write contents in disk file as a sequence of characters. The constructor of the class requires file path and creates automatically if it does not exist depending on the user operation system security settings.

Read Full Tutorial

Posted in Java. Tags: . Leave a Comment »