當前位置: 首頁>>代碼示例>>VB.NET>>正文


VB.NET SByte.MaxValue字段代碼示例

本文整理匯總了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;未經允許,請勿轉載。