?? mysystem.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 + -