comparing Type object to object’s type

So I have a variable Type rt = Type.GetType(str); that I need to compare to a type. So by default I used the is keyword, it goes a little something like this:

Type rt = Type.GetType(str); if(rt is Objects.Key) //Key is a public class { //dostuff } 

So why is it that if statement always returns false? What should I be doing instead?

by Soundless_Pr via /r/csharp

Leave a Reply