本文整理汇总了VB.NET中System.Byte.MaxValue字段的典型用法代码示例。如果您正苦于以下问题:VB.NET Byte.MaxValue字段的具体用法?VB.NET Byte.MaxValue怎么用?VB.NET Byte.MaxValue使用的例子?那么恭喜您, 这里精选的字段代码示例或许可以为您提供帮助。您也可以进一步了解该字段所在类System.Byte
的用法示例。
在下文中一共展示了Byte.MaxValue字段的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: MinMaxFields
Public Sub MinMaxFields(ByVal numberToSet As Integer)
If numberToSet <= CInt([Byte].MaxValue) And numberToSet >= CInt([Byte].MinValue) Then
' You must explicitly convert an integer to a byte.
MemberByte = CType(numberToSet, [Byte])
' Displays MemberByte using the ToString() method.
Console.WriteLine("The MemberByte value is {0}.", MemberByte.ToString())
Else
Console.WriteLine("The value {0} is outside of the range of possible Byte values.", numberToSet.ToString())
End If
End Sub
示例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