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

📄 fox-infoclass.cls

📁 vb 编写的获得系统硬件信息的程序
💻 CLS
📖 第 1 页 / 共 2 页
字号:

Public Function GetLongMonthName3() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME3, Buffer, 99)
   GetLongMonthName3 = LPSTRToVBString(Buffer)
End Function

Public Function GetLongMonthName2() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME2, Buffer, 99)
   GetLongMonthName2 = LPSTRToVBString(Buffer)
End Function

Public Function GetLongMonthName1() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SMONTHNAME1, Buffer, 99)
   GetLongMonthName1 = LPSTRToVBString(Buffer)
End Function

Public Function GetTimeFormat() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIMEFORMAT, Buffer, 99)
   GetTimeFormat = LPSTRToVBString(Buffer)
End Function
Public Function GetShortDateFormat() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SSHORTDATE, Buffer, 99)
   GetShortDateFormat = LPSTRToVBString(Buffer)
End Function
Public Function GetTimeSeparator() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STIME, Buffer, 99)
   GetTimeSeparator = LPSTRToVBString(Buffer)
End Function
Public Function GetDateSeparator() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDATE, Buffer, 99)
   GetDateSeparator = LPSTRToVBString(Buffer)
End Function
Public Function GetLeadingZerosForDecimal() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_ILZERO, Buffer, 99)
   GetLeadingZerosForDecimal = LPSTRToVBString(Buffer)
End Function
Public Function GetNumberOfFractionalDigits() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDIGITS, Buffer, 99)
   GetNumberOfFractionalDigits = LPSTRToVBString(Buffer)
End Function
Public Function GetDigitGrouping() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SGROUPING, Buffer, 99)
   GetDigitGrouping = LPSTRToVBString(Buffer)
End Function
Public Function GetThousandSeparator() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, Buffer, 99)
   GetThousandSeparator = LPSTRToVBString(Buffer)
End Function
Public Function GetCurrencySymbol() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SCURRENCY, Buffer, 99)
   GetCurrencySymbol = LPSTRToVBString(Buffer)
End Function
Public Function GetLanguage() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, Buffer, 99)
   GetLanguage = LPSTRToVBString(Buffer)
End Function
Public Function GetCountry() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGCOUNTRY, Buffer, 99)
   GetCountry = LPSTRToVBString(Buffer)
End Function
Public Function GetLongDateFormat() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SLONGDATE, Buffer, 99)
   GetLongDateFormat = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay1() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME1, Buffer, 99)
   GetLongNameDay1 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay2() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME2, Buffer, 99)
   GetLongNameDay2 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay3() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME3, Buffer, 99)
   GetLongNameDay3 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay4() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME4, Buffer, 99)
   GetLongNameDay4 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay5() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME5, Buffer, 99)
   GetLongNameDay5 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay6() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME6, Buffer, 99)
   GetLongNameDay6 = LPSTRToVBString(Buffer)
End Function
Public Function GetLongNameDay7() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDAYNAME7, Buffer, 99)
   GetLongNameDay7 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay1() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME1, Buffer, 99)
   GetShortNameDay1 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay2() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME2, Buffer, 99)
   GetShortNameDay2 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay3() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME3, Buffer, 99)
   GetShortNameDay3 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay4() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME4, Buffer, 99)
   GetShortNameDay4 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay5() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME5, Buffer, 99)
   GetShortNameDay5 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay6() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME6, Buffer, 99)
   GetShortNameDay6 = LPSTRToVBString(Buffer)
End Function
Public Function GetShortNameDay7() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SABBREVDAYNAME7, Buffer, 99)
   GetShortNameDay7 = LPSTRToVBString(Buffer)
End Function
Public Function GetDecimalSeparator() As String
   Dim Buffer As String * 100
   Dim dl&
   dl& = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, Buffer, 99)
   GetDecimalSeparator = LPSTRToVBString(Buffer)
End Function
Private Function LPSTRToVBString$(ByVal s$)
   Dim nullpos&
   nullpos& = InStr(s$, Chr$(0))
   If nullpos > 0 Then
      LPSTRToVBString = Left$(s$, nullpos - 1)
   Else
      LPSTRToVBString = ""
   End If
End Function
Public Function TempDir() As String
    Dim sTmp1$
    sTmp1 = Environ$("temp")
    While Right$(sTmp1, 1) = "\"
        sTmp1 = Left$(sTmp1, Len(sTmp1) - 1)
    Wend
    If sTmp1 <> "" Then
        On Error Resume Next
        MkDir sTmp1
        On Error GoTo 0
    End If
    TempDir = sTmp1
End Function
Public Function GetOS() As String
    GetOS = Environ$("os")
End Function
Public Function GetUSERNAME() As String
    GetUSERNAME = Environ$("username")
End Function
Public Function GetSystemDrive() As String
    GetSystemDrive = Environ$("systemdrive")
End Function
Public Function GetWinDir() As String
    GetWinDir = Environ$("windir")
End Function
Public Function SystemDir() As String
Dim result
Dim SystemDirectory As String
SystemDirectory = Space(144)
result = GetSystemDirectory(SystemDirectory, 144)
If result = 0 Then
    MsgBox "Cannot Get the Windows System Directory", vbCritical, "Warning"
Else
    SystemDir = Trim(SystemDirectory)
End If
End Function


⌨️ 快捷键说明

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