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

📄 module1.bas

📁 ICQ通讯程序 ICQ通讯程序 ICQ通讯程序
💻 BAS
字号:
Attribute VB_Name = "Module1"
Global Const MaxUsers As Integer = 100
Public UserInfo(MaxUsers) As UserStatisticalData
Public SavedUserInfo As SavedUserStatisticalData
Public UserPersonalInfo As UserPersonalData
Public Buddy As String * 21
Public Ignore As String * 21

Public Temp As String
Public Const vbOrange = &H80FF&

Declare Function WritePrivateProfileString _
Lib "kernel32" Alias "WritePrivateProfileStringA" _
(ByVal lpApplicationname As String, ByVal _
lpKeyName As Any, ByVal lsString As Any, _
ByVal lplFilename As String) As Long

Declare Function GetPrivateProfileString Lib _
"kernel32" Alias "GetPrivateProfileStringA" _
(ByVal lpApplicationname As String, ByVal _
lpKeyName As String, ByVal lpDefault As _
String, ByVal lpReturnedString As String, _
ByVal nSize As Long, ByVal lpFileName As _
String) As Long

Public Type UserStatisticalData
     UserID As String
     UserName As String
     UserIP As String
     Nickname As String
     Password As String
     
     
     InRoom As String
     
     NickColor As Variant
     
     InUse As Boolean
     Status As String
End Type

Public Type SavedUserStatisticalData
     UserID As String * 21
     UserName As String * 21
     LastUserIP As String * 16
     Nickname As String * 21
     Password As String * 21
End Type

Public Type UserPersonalData
    Sex As String * 7
    Country As String * 21
    BirthDay As String * 11
    Age As String * 4
    Webpage As String * 101
    About As String * 451
End Type

Public Type BuddyProperties
    UserID As String * 21
    UserName As String * 21
End Type

Public Function TranslateStatus(StatusText As String) As String

    If StatusText = "Online" Then
    
       TranslateStatus = StatusText

    ElseIf StatusText = "Away" Then
    
       TranslateStatus = StatusText
    
    ElseIf StatusText = "DND" Then
    
       TranslateStatus = StatusText
    
    ElseIf UserInfo(u).Status = "Invisible" Then

       TranslateStatus = "Offline"
    
    ElseIf UserInfo(u).Status = "WT" Then

       TranslateStatus = "Webtour"
    
    ElseIf UserInfo(u).Status = "WTHost" Then

       TranslateStatus = "WebtourHost"
    
    Else

       ' Don't know or unsupported. Send Offline notice for now.
       TranslateStatus = "Offline"
    
    End If

End Function

Public Function LoadINI(INIFileName As String, KeySection As String, KeyKey As String) As String

Dim lngResult As Long
Dim strFileName
Dim strResult As String * 501
strFileName = App.Path & "\" & INIFileName & ".ini" 'Declare your ini file !
lngResult = GetPrivateProfileString(KeySection, _
KeyKey, strFileName, strResult, Len(strResult), _
strFileName)
If lngResult = 0 Then
'An error has occurred
Call MsgBox("An error has occurred while calling the API function", vbExclamation)
Else
LoadINI = Trim(strResult)
End If

End Function

Public Function SaveINI(INIFileName As String, KeySection As String, KeyKey As String, KeyValue As String)

Dim lngResult As Long
Dim strFileName
strFileName = App.Path & "\" & INIFileName & ".ini" 'Declare your ini file !
lngResult = WritePrivateProfileString(KeySection, _
KeyKey, KeyValue, strFileName)
If lngResult = 0 Then
'An error has occurred
Call MsgBox("An error has occurred while calling the API function", vbExclamation)
End If

End Function

⌨️ 快捷键说明

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