本文实例讲述了C#自定义类型强制转换的用法。分享给大家供大家参考。具体分析如下: 先来举一个小例子 类定义: public class MyCurrency { public uint Dollars; public ushort Cents; public MyCurrency(uint dollars, ushort cents) { this.Dollars = dollars; this.Cents = cents; } public override string ToString() { return string.Format