⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mysystem.vb

📁 一个VB.NET 写的NAMESPACE,可以在WINDOWS MOBILE 5,6平台上获得当前系统时间,内存使用状态,程序所在位置和设备名称. 直接应用函数名就可以了.没有传入参数.除了时间,其
💻 VB
字号:
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
'该文件为系统信息读取的NAMESPACE
'
'该文件由K9998制作
'QQ:35333120
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Imports System.IO
Imports System.Reflection
Imports System.Net

Namespace K9998system

    Public Class Gettime


        Private Structure SYSTEMTIME
            Public wYear As UShort
            Public wMonth As UShort
            Public wDayOfWeek As UShort
            Public wDay As UShort
            Public wHour As UShort
            Public wMinute As UShort
            Public wSecond As UShort
            Public wMilliseconds As UShort
        End Structure

        Private Declare Function GetSystemTime Lib "CoreDll.dll" (ByRef lpSystemTime As SYSTEMTIME) As UInteger
        Private Declare Function SetSystemTime Lib "CoreDll.dll" (ByRef lpSystemTime As SYSTEMTIME) As UInteger

        
        Public Shared Function GetDateTime() As Date
            Dim st As SYSTEMTIME

            GetSystemTime(st)

            '返回当前系统时间(data)
            Return New Date(st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond, st.wMilliseconds)
        End Function

        Public Shared Sub SetDateTime(ByVal newDateTime As Date)
            Dim newTime As SYSTEMTIME

            '转换data为系统时间
            newTime.wYear = newDateTime.Year
            newTime.wMonth = newDateTime.Month
            newTime.wDay = newDateTime.Day
            newTime.wHour = newDateTime.Hour
            newTime.wMinute = newDateTime.Minute
            newTime.wSecond = newDateTime.Second
            newTime.wMilliseconds = newDateTime.Millisecond

            SetSystemTime(newTime)
        End Sub

    End Class

    Public Class Getmomeny

        Friend Structure MEMORYSTATUS
            Public dwLength As UInteger
            Public dwMemoryLoad As UInteger
            Public dwTotalPhys As UInteger
            Public dwAvailPhys As UInteger
            Public dwTotalPageFile As UInteger
            Public dwAvailPageFile As UInteger
            Public dwTotalVirtual As UInteger
            Public dwAvailVirtual As UInteger
        End Structure

        Friend Declare Function GlobalMemoryStatus Lib "CoreDll.Dll" (ByRef ms As MEMORYSTATUS) As Integer
	
	'返回当前内存使用状态
        Friend Shared Function GetMemory() As MEMORYSTATUS

            Dim memStatus As New MEMORYSTATUS
            GlobalMemoryStatus(memStatus)

            Return memStatus
        End Function
    End Class

    Public Class GetAppDir

	'返回当前程序所在位置
        Public Function GetApplicationDirectory() As String

            Return Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetModules(0).FullyQualifiedName)

        End Function
    End Class

    Public Class GetPlatform
	'返回设备名称
        Private Function GetDeviceName() As String

            Return Dns.GetHostName()

        End Function
    End Class
End Namespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -