What is the difference between typeof and the is keyword?

You should use is AClass on instances and not to compare types:

var myInstance = new AClass();
var isit = myInstance is AClass; //true

is works also with base-classes and interfaces:

MemoryStream stream = new MemoryStream();

bool isStream = stream is Stream; //true
bool isIDispo = stream is IDisposable; //true

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)