本文整理汇总了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
示例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