本文整理匯總了VB.NET中System.IO.Ports.StopBits枚舉的典型用法代碼示例。如果您正苦於以下問題:VB.NET StopBits枚舉的具體用法?VB.NET StopBits怎麽用?VB.NET StopBits使用的例子?那麽, 這裏精選的枚舉代碼示例或許可以為您提供幫助。
在下文中一共展示了StopBits枚舉的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: SerialPort
Dim mySerialPort As New SerialPort("COM1")
mySerialPort.BaudRate = 9600
mySerialPort.Parity = Parity.None
mySerialPort.StopBits = StopBits.One
mySerialPort.DataBits = 8
mySerialPort.Handshake = Handshake.None
mySerialPort.RtsEnable = True
示例2: SetPortStopBits
' Display StopBits values and prompt user to enter a value.
Public Shared Function SetPortStopBits(defaultPortStopBits As StopBits) As StopBits
Dim stopBits As String
Console.WriteLine("Available StopBits options:")
For Each s As String In [Enum].GetNames(GetType(StopBits))
Console.WriteLine(" {0}", s)
Next
Console.Write("Enter StopBits value (None is not supported and " &
vbLf & "raises an ArgumentOutOfRangeException. " &
vbLf & " (Default: {0}):", defaultPortStopBits.ToString())
stopBits = Console.ReadLine()
If stopBits = "" Then
stopBits = defaultPortStopBits.ToString()
End If
Return CType([Enum].Parse(GetType(StopBits), stopBits, True), StopBits)
End Function