C#中無法強制將ushort轉爲UInt16,例如下面會報錯:
UInt16 x = 1;
UInt16 y = 2;
UInt16 z = x + y;//報錯
正確的轉換方法如下:
UInt16 x = 1;
UInt16 y = 2;
UInt16 z = Convert.ToUInt16(x + y);
C#中無法強制將ushort轉爲UInt16,例如下面會報錯:
UInt16 x = 1;
UInt16 y = 2;
UInt16 z = x + y;//報錯
正確的轉換方法如下:
UInt16 x = 1;
UInt16 y = 2;
UInt16 z = Convert.ToUInt16(x + y);
this.richTextBox2.SelectionStart=this.richTextBox2.Text.Length; this.richTextBox2.ScrollToCaret();
public partial class MyMessageBox : Window { public static void Show(string strErrorInfo) {