How to Encrypt and Decrypt Data Using MD5 Algorithm in Visual Basic .Net

0 comments

Posted on 27th November 2011 by Admin in Visual Basic .Net

,


Download Sample Project
Visual Basic .Net sample on how to encrypt and decrypt data using the MD5 Message-Digest Algorithm. You may add the code in module area and call the Encrypt/Decrypt function in your vb.net application.
In web services application, call the encrypt function before sending the data over the internet specially for those sensitive information and call decrypt function in your web services application.

Sample Data Below :

Original Text : mypassword
Encrypted Text : RV58Z7olCYxK9sZjkf6c8g==

Visual Basic 2010 – Custom Exceptions Sample

0 comments

Posted on 3rd May 2010 by Admin in Visual Basic 2010

, ,

This sample contains two projects: a Windows Forms client and a class library.

Class Library (Server)

The class library defines theCustomerand a set of custom exception classes that are used to expose application-defined errors. The exception classes are related by an inheritance hierarchy. The base class isCRMSystemException, which inherit fromApplicationException.CustomerExceptionandEmployeeExceptioninherit fromCRMSystemException. There are two more exceptions which inherit fromCustomerException:CustomerNotFoundExceptionandCustomerNotDeletedException.Each class exposes different levels of information and functionality.

Client Code

The client application has a reference to the class library. Two command buttons execute methods against theCustomerclass and catch the custom exceptions. A third command button causes an unhandled exception. In addition, there is a check box labeled “Turn on Global Exception Trap” that enables a global exception trap. When enabled, the code defined in theOnThreadExceptionmethod will be executed instead of the default Windows Forms handler.

Download Project