Tuesday, October 2, 2007

Creating a type of Type based on a string

I recently ran into a case where I had a string value like "System.String" and I needed to determine what type this represented, then assign that to a member of type Type.

Type t = Type.GetType("System.String");

No comments:

Can't RDP? How to enable / disable virtual machine firewall for Azure VM

Oh no!  I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore.  I did ...