Archive | C# RSS feed for this section

dynamic vs object

      People keep asking me what is the difference between “dynamic” and the old friend “object”. Well, answer is a little tricky; in order to show the difference, it’s better to take a look at both of them more detailed.      Let me start with the old friend “object”, that is nothing but a shortcut [...]

Read more

Generating Managed WMI Classes

  If you are also writing code using WMI on C#, probably you’ve also use the following classes; ManagementScope, ManagementObjectSearcher, ManagementObjectCollection and also ManagementObject; But they’re not such easy classes to deal with, espacially if you’re using WMI methods. Take a look at this code: private void List(string containerName) { string sorgu = String.Format(“SELECT * [...]

Read more

Reflection and Dynamic Assemblies

Within one of my applications, I need to analyze loaded assemblies for a specific attribute. To do so I’ve write the following code : foreach (System.Reflection.Assembly assembly in System.AppDomain.CurrentDomain.GetAssemblies()) { //Do something with the assembly } But I got System.NotSupportedException exception when I’ve execute that code. After a little serach through internet, I found the [...]

Read more
QR Code Business Card