色偷偷偷久久伊人大杳蕉,色爽交视频免费观看,欧美扒开腿做爽爽爽a片,欧美孕交alscan巨交xxx,日日碰狠狠躁久久躁蜜桃

x
x
查看: 7026|回復(fù): 0
打印 上一主題 下一主題

VB.NET下采用索引對(duì)WinIO的封裝類(lèi)(WinIO.vb)

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2009-4-3 00:15:09 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式
關(guān)鍵詞: NET , WinIO , 封裝 , 索引
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Threading
Imports System.Windows.Forms 'MessageBox需要
'菜農(nóng)HotPower@126.com 2008.11.13 于雁塔菜地
Public Class WinIO
#Region "WinIO API"
    Private Shared Function InitializeWinIo() As Boolean
    End Function
    Private Shared Function ShutdownWinIo() As Boolean
    End Function
    Private Shared Function GetPortVal( _
        ByVal PortAddr As UInt16, ByRef PortVal As UInt32, ByVal bSize As Byte) As Boolean
    End Function
    Private Shared Function SetPortVal( _
        ByVal PortAddr As UInt16, ByVal PortVal As UInt32, ByVal bSize As Byte) As Boolean
    End Function
#End Region
    '在Form1.cs內(nèi)加Private WinIoPort As New WinIO()
    Private blEnable As Boolean
    Private blError As Boolean
    Sub New() '//構(gòu)造函數(shù)(自動(dòng)運(yùn)行)
        blEnable = False
        blError = False
        Try
            blEnable = InitializeWinIo() '加載WinIO
        Catch ex As System.Exception
            MessageBox.Show(ex.Message, "系統(tǒng)提示", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub
    Protected Overrides Sub Finalize() '析構(gòu)函數(shù)(自動(dòng)運(yùn)行)
        If blEnable = True Then
            ShutdownWinIo() '卸載WinIO
        End If
    End Sub
    Public ReadOnly Property Err() As Boolean
        Get
            Return blError
        End Get
    End Property
    Public ReadOnly Property Enable() As Boolean
        Get
            Return blEnable
        End Get
    End Property
    Default Public Property My(ByVal Index As UInt16) As Byte
        'x = WinIoPort(&H378)
        Get
            Dim val As UInt32
            blError = GetPortVal(Index, val, 1)
            Return (val And &HFF)
        End Get
        'WinIoPort(&H378) = &H55
        Set(ByVal value As Byte)
            blError = SetPortVal(Index, value, 1)
        End Set
    End Property
    Default Public Property My(ByVal Index As UInt16, ByVal size As Byte) As UInt32
        'x = WinIoPort(&H378, 1) x = WinIoPort(&H378, 2) x = WinIoPort(&H378, 4)
        Get
            Dim val As UInt32
            blError = GetPortVal(Index, val, size)
            Return val
        End Get
        'WinIoPort(&H378, 1) = &H55 WinIoPort(&H378, 2) = &H5555
        'WinIoPort(&H378, 4) = &H12345678
        Set(ByVal value As UInt32)
            blError = SetPortVal(Index, value, size)
        End Set
    End Property
End Class

本版積分規(guī)則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權(quán)所有   京ICP備16069177號(hào) | 京公網(wǎng)安備11010502021702
快速回復(fù) 返回頂部 返回列表