Marshal.GenerateGuidForType(Type)和Type.GUID之间有什么区别? [英] What's the difference between Marshal.GenerateGuidForType(Type) and Type.GUID?
本文介绍了Marshal.GenerateGuidForType(Type)和Type.GUID之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Type classType = typeof(SomeClass);
bool equal = Marshal.GenerateGuidForType(classType) == classType.GUID;
我还没有发现没有通过这种情况的案件.
I haven't found a case that fail this condition.
所以为什么和何时我应该使用 Marshal
方法,而不是简单地获取 GUID
属性?
So why and when should I use the Marshal
method instead of simply getting the GUID
property?
推荐答案
查看全文