本文整理汇总了VB.NET中System.SByte.MaxValue字段的典型用法代码示例。如果您正苦于以下问题:VB.NET SByte.MaxValue字段的具体用法?VB.NET SByte.MaxValue怎么用?VB.NET SByte.MaxValue使用的例子?那么恭喜您, 这里精选的字段代码示例或许可以为您提供帮助。
在下文中一共展示了SByte.MaxValue字段的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的VB.NET代码示例。
示例1: CSByte
Dim longValue As Long = -130
Dim byteValue As SByte
If longValue <= SByte.MaxValue AndAlso _
longValue >= SByte.MinValue Then
byteValue = CSByte(longValue)
Console.WriteLine("Converted long integer value to {0}.", byteValue)
Else
Dim rangeLimit As SByte
Dim relationship As String
If longValue > SByte.MaxValue Then
rangeLimit = SByte.MaxValue
relationship = "greater"
Else
rangeLimit = SByte.MinValue
relationship = "less"
End If
Console.WriteLine("Conversion failure: {0:n0} is {1} than {2}.", _
longValue, _
relationship, _
rangeLimit)
End If
开发者ID:VB.NET开发者,项目名称:System,代码行数:24,代码来源:SByte.MaxValue
示例2: Tester
Public Class Tester
Public Shared Sub Main
Dim result As New System.Text.StringBuilder()
result.AppendLine("MaxValue...")
Dim maxByte As Byte = Byte.MaxValue
Dim maxSByte As SByte = SByte.MaxValue
Dim maxShort As Short = Short.MaxValue
Dim maxUShort As UShort = UShort.MaxValue
Dim maxInteger As Integer = Integer.MaxValue
Dim maxUInteger As UInteger = UInteger.MaxValue
Dim maxLong As Long = Long.MaxValue
Dim maxULong As ULong = ULong.MaxValue
result.Append("Byte ").AppendLine(maxByte)
result.Append("SByte ").AppendLine(maxSByte)
result.Append("Short ").AppendLine(maxShort)
result.Append("UShort = ").AppendLine(maxUShort)
result.Append("Integer = ").AppendLine(maxInteger)
result.Append("UInteger = ").AppendLine(maxUInteger)
result.Append("Long = ").AppendLine(maxLong)
result.Append("ULong = ").AppendLine(maxULong)
Console.WriteLine(result.ToString())
End Sub
End Class
开发者ID:VB程序员,项目名称:System,代码行数:26,代码来源:SByte.MaxValue
注:本文中的System.SByte.MaxValue字段示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论