Category: C#

Built-in method to validate email address in C#

Are you looking for a built-in method in C# which lets you validate email address. If yes , you can use the EmailAddressAttribute class that is defined in the System.ComponentModel.DataAnnotations namespace to do it. How to validate email address in C# using EmailAddressAttribute class ? Below is a sample code snippet demonstrating the usage of the EmailAddressAttribute class to validate the email address in C#.

How to Create a Guid Value in C# ?

If you want to create a new Guid value in C# which is random , you can use the Guid class to achieve it. Below is a sample code snippet demonstrating how to do it. How to Create a Guid Value in C# ?

How to get the Machine Name from a .NET Application using C# ?

You can use the MachineName property defined in the System.Environment class in order to get the Machine Name from your .NET Application. How to get the Machine Name from a .NET Application using C# ? Here’s a code sample demonstrating how to do it. This should display the machine name. The output of the program would be The Machine Name is Abundantcode-LT

How to run the Universal App outside Visual Studio in Windows 10 ?

The Windows Store App built using the Universal App template in Visual Studio 2013 produces the .exe file which is available in the bin folder but when you double click on this exe folder , you will get an error message stating that “This application can only run in the context of an app container.” How to run the Universal App outside Visual Studio in…