代码之家  ›  专栏  ›  技术社区  ›  Andreas Bonini

如何在f中从system.int32转换为system.uint16#

  •  3
  • Andreas Bonini  · 技术社区  · 15 年前

    有更好(更短)的吗?比下面的方式?

    let cpucount = System.UInt16.Parse( reader.GetInt32(3).ToString() )
    
    2 回复  |  直到 15 年前
        1
  •  4
  •   Brian    15 年前
        2
  •  1
  •   SLaks    15 年前

    我不知道f,但你可以写 Convert.ToUint16(reader.GetInt32(3)) .

    编辑 : According to MSDN ,你可以通过写作 uint16 reader.GetInt32(3) .