Difference between a class and struct in .net

Thought I will share some interesting differences between a .net class and a struct. Class Struct Allocated on the heap. Allocated on the stack. They are value types and don’t require heap allocation. A variable of a class type stores a reference to a dynamically allocated object. A variable of a struct type directly stores […]
Continue reading…

 

Convert a VB6 project to VB.net Visual Studio 2010

Are you having trouble converting VB6 project to VB.net Visual Studio 2010. Well just to be frank you should have long back converted this VB6 project of yours to VB.net. VB6 is ancient and just because your code works doesn’t mean that you won’t migrate it to a newer platform. In my opinion let your […]
Continue reading…

 

Find an element in a list

Recently I worked on one C# project. Got to say it’s hell lot easier to code :-). Found something cool while working on template based List class. Guess that you got a list of employees stored in List, so how will you locate a particular employee by his name or based on certain employee attributes: […]
Continue reading…

 

WMI in .Net

It’s quite easy to work with WMI in .net. Follow these steps to get details of Win32_VideoController. Namespace to use is System.Management. 1. Create a management class object. [sourcecode language=’cpp’]Dim MngClass As New ManagementClass(“Win32_VideoController”)[/sourcecode] 2. Create a management object class collection instance and fill out this collection likewise… [sourcecode language=’vb’]Dim MngObjCollection As ManagementObjectCollection = MngClass.GetInstances […]
Continue reading…

 

netstat in .net

netstat is a cool tool to view all active tcpip/udp connections in our computer along with the names of applications who have opened these ports/connections. So as a demo open up command prompt and type netstat /a netstat /b -> displays exes which are using a particular port/connection netstat /? -> displays helps for this […]
Continue reading…

 

StringBuilder

One of the classes in .Net that I like is the StringBuilder class. So what is it? It’s like the StringBuffer class in java. It’s a mutable string class which does faster operation while concatenation and other string related functions because internally it doesn’t recreate String objects but maintains a big enough buffer to prevent […]
Continue reading…