Category Archives: VB.NET

PHPHOST BLOG

Web Hosting Related Articles You May Need

.NET Programming for Absolute Beginners [Free Video Series]

Channel 9 has just launched an absolute beginner programming series to help people learn to program. This FREE training series is created for programmers who have no experience with C# or VB.NET

The series of 49 episodes (24 episodes for C# and 25… Continue reading

Posted in C#, Free Learning, Syndicated, VB.NET | Comments Off on .NET Programming for Absolute Beginners [Free Video Series]

Remove all Lower Case Letters using C#

I came across a discussion where the OP wanted to use only the first letter of a word in a string. The first letter of each word was capitalized, so his requirement was to abbreviate the sentence by removing all lower case letters in a string.
For exam… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Remove all Lower Case Letters using C#

Remove all Lower Case Letters using C#

I came across a discussion where the OP wanted to use only the first letter of a word in a string. The first letter of each word was capitalized, so his requirement was to abbreviate the sentence by removing all lower case letters in a string.
For exam… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Remove all Lower Case Letters using C#

Use Anonymous Method with a Delegate in C#

A colleague of mine asked me a question – ‘How can we use an Anonymous method with a Delegate and when should we do it”.By using anonymous methods, you reduce the coding overhead in instantiating delegates, by eliminating the need to create a separ… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Use Anonymous Method with a Delegate in C#

Determine if your Laptop is Running on battery using C# or VB.NET

Here’s some code to programmatically find out if your laptop is currently running on battery power. I have created a Windows Form application and added the following code on a button click event which uses the SystemInformation.PowerStatus propertyC#… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Determine if your Laptop is Running on battery using C# or VB.NET

Check Database connection using C# or VB.NET

As a programmer, one of the most common tasks in your application is to connect to the database. Here’s a very simple way to check your database connection before you start any task or use this as a service to check the connection and pause tasks if … Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Check Database connection using C# or VB.NET

Programmatically find CLR version for a .NET assembly

When it comes to extracting information from an assembly, Red Gate’s Reflector or the .NET Framework ILDASM tool are two obvious choices.However if you have to programmatically determine the CLR version of an assembly it was compiled against, then us… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Programmatically find CLR version for a .NET assembly

Convert DateTime to Different TimeZones

The TimeZoneInfo.ConvertTimeBySystemTimeZoneId in .NET 3.5 and 4.0, converts a time to the time in another time zone, based on a time zone identifier. Here’s how to use this method using different time zone identifiers like “India Standard Time”,… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Convert DateTime to Different TimeZones

Programmatically Determine the Operating System using .NET

Here’s how to programmatically determine the Windows OS you are using. I will make use of the ManagementObjectSearcher class hereC#using System;using System.Management;namespace ConsoleApplication1{class Program{ public static void Main() { … Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Programmatically Determine the Operating System using .NET

Detect if a String contains Special Characters

There are many ways to detect if a String contains Special Characters. In this code snippet, I will show a quick way to detect special characters using Regex.C#static void Main(string[] args){ string str = “Th!s $tri^g c@n$ist $pecial ch@rs”; Mat… Continue reading

Posted in C#, Syndicated, VB.NET | Comments Off on Detect if a String contains Special Characters