亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? rs232.vb

?? 在vb.net 中如何使用計(jì)算機(jī)的串口
?? VB
?? 第 1 頁 / 共 3 頁
字號(hào):
            Else
                ' Retrieve modem status
                Dim lpModemStatus As Integer
                If Not GetCommModemStatus(mhRS, lpModemStatus) Then
                    Throw New ApplicationException("Unable to get modem status")
                Else
                    Return CType(lpModemStatus, ModemStatusBits)
                End If
            End If
        End Get
    End Property

    ' This property gets or sets the Parity
    Public Property Parity() As DataParity
        Get
            Return meParity
        End Get
        Set(ByVal Value As DataParity)
            meParity = Value
        End Set
    End Property

    ' This property gets or sets the Port
    Public Property Port() As Integer
        Get
            Return miPort
        End Get
        Set(ByVal Value As Integer)
            miPort = Value
        End Set
    End Property

    ' This write-only property sets or resets the RTS line.
    Public WriteOnly Property Rts() As Boolean
        Set(ByVal Value As Boolean)
            If Not mhRS = -1 Then
                If Value Then
                    EscapeCommFunction(mhRS, Lines.SetRts)
                Else
                    EscapeCommFunction(mhRS, Lines.ClearRts)
                End If
            End If
        End Set
    End Property

    ' This property gets or sets the StopBit
    Public Property StopBit() As DataStopBit
        Get
            Return meStopBit
        End Get
        Set(ByVal Value As DataStopBit)
            meStopBit = Value
        End Set
    End Property

    ' This property gets or sets the Timeout
    Public Overridable Property Timeout() As Integer
        Get
            Return miTimeout
        End Get
        Set(ByVal Value As Integer)
            miTimeout = CInt(IIf(Value = 0, 500, Value))
            ' If Port is open updates it on the fly
            pSetTimeout()
        End Set
    End Property

    ' This property gets or sets the working mode to overlapped
    '   or non-overlapped.
    Public Property WorkingMode() As Mode
        Get
            Return meMode
        End Get
        Set(ByVal Value As Mode)
            meMode = Value
        End Set
    End Property

#End Region


#Region "Win32API"
    ' The following functions are the required Win32 functions needed to 
    '   make communication with the Comm Port possible.

    <DllImport("kernel32.dll")> Private Shared Function BuildCommDCB( _
        ByVal lpDef As String, ByRef lpDCB As DCB) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function ClearCommError( _
        ByVal hFile As Integer, ByVal lpErrors As Integer, _
        ByVal l As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function CloseHandle( _
        ByVal hObject As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function CreateEvent( _
        ByVal lpEventAttributes As Integer, ByVal bManualReset As Integer, _
        ByVal bInitialState As Integer, _
        <MarshalAs(UnmanagedType.LPStr)> ByVal lpName As String) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function CreateFile( _
        <MarshalAs(UnmanagedType.LPStr)> ByVal lpFileName As String, _
        ByVal dwDesiredAccess As Integer, ByVal dwShareMode As Integer, _
        ByVal lpSecurityAttributes As Integer, _
        ByVal dwCreationDisposition As Integer, _
        ByVal dwFlagsAndAttributes As Integer, _
        ByVal hTemplateFile As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function EscapeCommFunction( _
        ByVal hFile As Integer, ByVal ifunc As Long) As Boolean
    End Function

    <DllImport("kernel32.dll")> Private Shared Function FormatMessage( _
        ByVal dwFlags As Integer, ByVal lpSource As Integer, _
        ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, _
        <MarshalAs(UnmanagedType.LPStr)> ByVal lpBuffer As String, _
        ByVal nSize As Integer, ByVal Arguments As Integer) As Integer
    End Function

    Private Declare Function FormatMessage Lib "kernel32" Alias _
     "FormatMessageA" (ByVal dwFlags As Integer, ByVal lpSource As Integer, _
     ByVal dwMessageId As Integer, ByVal dwLanguageId As Integer, _
     ByVal lpBuffer As StringBuilder, ByVal nSize As Integer, _
     ByVal Arguments As Integer) As Integer

    <DllImport("kernel32.dll")> Public Shared Function GetCommModemStatus( _
        ByVal hFile As Integer, ByRef lpModemStatus As Integer) As Boolean
    End Function

    <DllImport("kernel32.dll")> Private Shared Function GetCommState( _
        ByVal hCommDev As Integer, ByRef lpDCB As DCB) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function GetCommTimeouts( _
        ByVal hFile As Integer, ByRef lpCommTimeouts As COMMTIMEOUTS) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function GetLastError() As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function GetOverlappedResult( _
        ByVal hFile As Integer, ByRef lpOverlapped As OVERLAPPED, _
        ByRef lpNumberOfBytesTransferred As Integer, _
        ByVal bWait As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function PurgeComm( _
        ByVal hFile As Integer, ByVal dwFlags As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function ReadFile( _
        ByVal hFile As Integer, ByVal Buffer As Byte(), _
        ByVal nNumberOfBytesToRead As Integer, _
        ByRef lpNumberOfBytesRead As Integer, _
        ByRef lpOverlapped As OVERLAPPED) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function SetCommTimeouts( _
        ByVal hFile As Integer, ByRef lpCommTimeouts As COMMTIMEOUTS) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function SetCommState( _
        ByVal hCommDev As Integer, ByRef lpDCB As DCB) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function SetupComm( _
        ByVal hFile As Integer, ByVal dwInQueue As Integer, _
        ByVal dwOutQueue As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function SetCommMask( _
        ByVal hFile As Integer, ByVal lpEvtMask As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function WaitCommEvent( _
        ByVal hFile As Integer, ByRef Mask As EventMasks, _
        ByRef lpOverlap As OVERLAPPED) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function WaitForSingleObject( _
        ByVal hHandle As Integer, ByVal dwMilliseconds As Integer) As Integer
    End Function

    <DllImport("kernel32.dll")> Private Shared Function WriteFile( _
        ByVal hFile As Integer, ByVal Buffer As Byte(), _
        ByVal nNumberOfBytesToWrite As Integer, _
        ByRef lpNumberOfBytesWritten As Integer, _
        ByRef lpOverlapped As OVERLAPPED) As Integer
    End Function

#End Region

#Region "Methods"

    ' This subroutine invokes a thread to perform an asynchronous read.
    '   This routine should not be called directly, but is used
    '   by the class.
    Public Sub _R()
        Dim iRet As Integer = Read(miTmpBytes2Read)
    End Sub

    ' This subroutine invokes a thread to perform an asynchronous write.
    '   This routine should not be called directly, but is used
    '   by the class.
    Public Sub _W()
        Write(mabtTmpTxBuf)
    End Sub

    ' This subroutine uses another thread to read from the Comm Port. It 
    '   raises RxCompleted when done. It reads an integer.
    Public Overloads Sub AsyncRead(ByVal Bytes2Read As Integer)
        If meMode <> Mode.Overlapped Then Throw New ApplicationException( _
            "Async Methods allowed only when WorkingMode=Overlapped")
        miTmpBytes2Read = Bytes2Read
        moThreadTx = New Thread(AddressOf _R)
        moThreadTx.Start()
    End Sub

    ' This subroutine uses another thread to write to the Comm Port. It 
    '   raises TxCompleted when done. It writes an array of bytes.
    Public Overloads Sub AsyncWrite(ByVal Buffer() As Byte)
        If meMode <> Mode.Overlapped Then Throw New ApplicationException( _
            "Async Methods allowed only when WorkingMode=Overlapped")
        If mbWaitOnWrite = True Then Throw New ApplicationException( _
            "Unable to send message because of pending transmission.")
        mabtTmpTxBuf = Buffer
        moThreadTx = New Thread(AddressOf _W)
        moThreadTx.Start()
    End Sub

    ' This subroutine uses another thread to write to the Comm Port. It 
    '   raises TxCompleted when done. It writes a string.
    Public Overloads Sub AsyncWrite(ByVal Buffer As String)
        Dim oEncoder As New System.Text.ASCIIEncoding
        Dim aByte() As Byte = oEncoder.GetBytes(Buffer)
        Me.AsyncWrite(aByte)
    End Sub

    ' This function takes the ModemStatusBits and returns a boolean value
    '   signifying whether the Modem is active.
    Public Function CheckLineStatus(ByVal Line As ModemStatusBits) As Boolean
        Return Convert.ToBoolean(ModemStatus And Line)
    End Function

    ' This subroutine clears the input buffer.
    Public Sub ClearInputBuffer()
        If Not mhRS = -1 Then
            PurgeComm(mhRS, PURGE_RXCLEAR)
        End If
    End Sub

    ' This subroutine closes the Comm Port.
    Public Sub Close()
        If mhRS <> -1 Then
            CloseHandle(mhRS)
            mhRS = -1
        End If
    End Sub

    ' This subroutine opens and initializes the Comm Port
    Public Overloads Sub Open()
        ' Get Dcb block,Update with current data
        Dim uDcb As DCB, iRc As Integer
        ' Set working mode
        Dim iMode As Integer = Convert.ToInt32(IIf(meMode = Mode.Overlapped, _
            FILE_FLAG_OVERLAPPED, 0))
        ' Initializes Com Port
        If miPort > 0 Then
            Try
                ' Creates a COM Port stream handle 
                mhRS = CreateFile("COM" & miPort.ToString, _
                GENERIC_READ Or GENERIC_WRITE, 0, 0, _
                OPEN_EXISTING, iMode, 0)
                If mhRS <> -1 Then
                    ' Clear all comunication errors
                    Dim lpErrCode As Integer
                    iRc = ClearCommError(mhRS, lpErrCode, 0&)
                    ' Clears I/O buffers
                    iRc = PurgeComm(mhRS, PurgeBuffers.RXClear Or _

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久66热偷产精品| 国产成人在线观看| 国产日本欧洲亚洲| 欧美亚洲一区三区| 国产69精品久久久久777| 婷婷六月综合亚洲| 亚洲色图欧美激情| 国产午夜精品一区二区| 欧美一区二区三区视频免费| 91小视频免费观看| 成人小视频在线观看| 久久精品国产色蜜蜜麻豆| 亚洲最大成人网4388xx| 国产精品久久久久aaaa| 久久综合狠狠综合久久激情 | 日本最新不卡在线| 综合久久给合久久狠狠狠97色| 26uuu色噜噜精品一区| 91精品蜜臀在线一区尤物| 日本高清不卡aⅴ免费网站| 懂色av一区二区三区免费观看| 免费日韩伦理电影| 日韩电影网1区2区| 亚洲一区在线观看免费观看电影高清| 中文字幕一区二区三区在线观看 | 国产无人区一区二区三区| 欧美一区二区日韩一区二区| 欧美色涩在线第一页| 欧美亚洲一区二区在线观看| 91久久精品网| 欧美日韩在线观看一区二区 | 中文字幕亚洲在| 欧美国产视频在线| 中文字幕的久久| 国产日韩精品一区二区三区| 久久综合久久99| 久久精品人人爽人人爽| 久久欧美中文字幕| 国产亚洲女人久久久久毛片| 国产亚洲美州欧州综合国| 国产女主播在线一区二区| 欧美国产精品劲爆| 成人欧美一区二区三区视频网页 | 久久精品国产999大香线蕉| 日本不卡不码高清免费观看| 蜜桃一区二区三区四区| 另类小说视频一区二区| 91丨九色丨蝌蚪丨老版| 99r国产精品| 色欧美片视频在线观看在线视频| 91免费看`日韩一区二区| 色屁屁一区二区| 欧美久久久久久久久| 日韩欧美激情在线| 久久久国产精华| 国产精品成人一区二区三区夜夜夜| 国产精品久久精品日日| 一区二区三区国产| 午夜av一区二区三区| 日本不卡一区二区三区高清视频| 美女视频网站黄色亚洲| 国产精品一区在线观看乱码| 不卡影院免费观看| 欧美午夜理伦三级在线观看| 日韩一级免费观看| 亚洲国产岛国毛片在线| 亚洲国产中文字幕| 奇米精品一区二区三区在线观看 | 日韩欧美一区二区免费| 久久久五月婷婷| 亚洲丝袜美腿综合| 午夜精品久久久久久久蜜桃app| 麻豆国产欧美一区二区三区| 国产 欧美在线| 欧美在线一区二区| 2024国产精品| 亚洲精品中文字幕在线观看| 免费观看成人av| 96av麻豆蜜桃一区二区| 91精品在线免费| 国产精品色眯眯| 日本一区中文字幕| 成人久久视频在线观看| 欧美人牲a欧美精品| 国产欧美日产一区| 午夜精品久久久久久久久| 国产91丝袜在线播放九色| 在线观看91av| 中文字幕中文字幕一区| 美女脱光内衣内裤视频久久网站 | 欧美私模裸体表演在线观看| 精品国产一区二区三区av性色| 亚洲欧美日韩国产中文在线| 麻豆国产欧美日韩综合精品二区 | 成人综合婷婷国产精品久久免费| 欧美肥大bbwbbw高潮| 中文字幕一区视频| 久久成人免费网| 欧美日韩一区二区在线观看视频 | 亚洲精品久久嫩草网站秘色| 成人一区二区三区视频| 欧美三区在线视频| 国产精品成人免费| 极品瑜伽女神91| 欧美日韩精品一区视频| 中文字幕一区二区三区在线观看| 久久不见久久见免费视频1| 91福利在线导航| 国产欧美综合在线| 日本va欧美va瓶| 欧美日韩亚洲综合一区二区三区| 国产精品久久久久久福利一牛影视 | 亚洲女子a中天字幕| 国产高清成人在线| 欧美肥妇bbw| 一区二区三区免费看视频| 成人激情免费电影网址| 久久精品亚洲国产奇米99| 男女性色大片免费观看一区二区 | 久久精品在这里| 美女国产一区二区三区| 欧美色精品在线视频| 亚洲激情av在线| 一本色道久久加勒比精品| 国产精品视频第一区| 成人一区二区视频| 国产欧美精品国产国产专区 | 亚洲另类在线视频| 97久久精品人人做人人爽| 国产精品萝li| av一区二区三区黑人| 中文字幕制服丝袜成人av| 国产精品自拍网站| www激情久久| 国产麻豆视频精品| 久久精品亚洲麻豆av一区二区 | 高清在线观看日韩| 国产清纯白嫩初高生在线观看91 | 亚洲成人免费av| 欧美无砖专区一中文字| 亚洲地区一二三色| 91精品国产综合久久久久久久 | 亚洲免费视频中文字幕| 99热精品国产| 亚洲欧美国产77777| 91成人免费在线视频| 亚洲国产日产av| 7777精品伊人久久久大香线蕉的| 日日夜夜一区二区| 91精品国产综合久久久久久漫画| 蜜臂av日日欢夜夜爽一区| 欧美精品一区男女天堂| 国产黄色91视频| 中文字幕一区二区5566日韩| 91浏览器在线视频| 亚洲午夜久久久久| 8x福利精品第一导航| 韩国理伦片一区二区三区在线播放| 精品国产污污免费网站入口 | 国产精品高清亚洲| 在线观看av一区二区| 午夜久久久久久| 欧美精品一区二区久久久| 粉嫩一区二区三区在线看| 亚洲欧美日韩国产综合在线 | 中文字幕一区二区三区在线不卡| 色综合天天性综合| 日韩专区中文字幕一区二区| 精品国产凹凸成av人网站| www.欧美色图| 婷婷激情综合网| 国产亚洲1区2区3区| 一本色道久久综合亚洲aⅴ蜜桃| 日韩精品每日更新| 国产亚洲1区2区3区| 在线精品观看国产| 精品一区二区免费视频| 亚洲猫色日本管| 欧美高清www午色夜在线视频| 国产一区二区看久久| 一区二区三区毛片| 欧美变态tickle挠乳网站| 99久久久国产精品免费蜜臀| 奇米影视一区二区三区| 日韩伦理av电影| 91精品中文字幕一区二区三区| 成人免费视频一区二区| 日韩一区欧美二区| 中文字幕一区二区三区在线观看| 91精品国产综合久久精品app | 北条麻妃国产九九精品视频| 视频一区二区不卡| 亚洲视频狠狠干| 精品乱人伦小说| 欧美在线一二三| 国产成人精品三级麻豆| 奇米在线7777在线精品| 一区二区三区电影在线播| 国产精品久久夜| 欧美电影免费提供在线观看|