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

📄 frmmain.frm

📁 这是好东西南的,大家快来看看呀,对于有C语言编程的的有好大的帮助
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   8985
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4080
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   8985
   ScaleWidth      =   4080
   StartUpPosition =   3  'Windows Default
   Begin VB.CheckBox ChkOffLineLogin 
      Caption         =   "隐身登陆"
      Height          =   495
      Left            =   1320
      TabIndex        =   4
      Top             =   3840
      Width           =   1575
   End
   Begin VB.CheckBox ChkAutoLogin 
      Caption         =   "自动登陆"
      Height          =   375
      Left            =   1320
      TabIndex        =   3
      Top             =   3480
      Width           =   1575
   End
   Begin VB.TextBox TxtPassword 
      Appearance      =   0  'Flat
      Height          =   375
      IMEMode         =   3  'DISABLE
      Left            =   1320
      PasswordChar    =   "*"
      TabIndex        =   2
      Top             =   2760
      Width           =   1815
   End
   Begin VB.ComboBox CmbLoginNum 
      Height          =   315
      Left            =   1320
      TabIndex        =   1
      Top             =   2040
      Width           =   1815
   End
   Begin VB.CommandButton CmdLogin 
      Caption         =   "登陆"
      Height          =   375
      Left            =   1560
      TabIndex        =   0
      Top             =   4680
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, _
                                                                        ByVal nSize As Long) As Long
Dim StrChkAutoLogin As String
Dim StrChkOffLineLogin As String
Dim StrWriteIn As String
Dim FileNum As Integer
Private Const DELITE = "^*^"

'
Private Sub CmbLoginNum_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then TxtPassword.SetFocus
End Sub

Private Sub CmdLogin_Click()
    If CmbLoginNum.Text <> "" And TxtPassword.Text <> "" Then
        If ChkAutoLogin.Value = True Then
            StrChkAutoLogin = "True"
        Else
            StrChkAutoLogin = "False"
        End If
        If ChkOffLineLogin.Value = True Then
            StrChkOffLineLogin = "True"
        Else
            StrChkOffLineLogin = "False"
        End If
        StrWriteIn = CmbLoginNum.Text & "^*^" & _
                     TxtPassword.Text & "^*^" & _
                     StrChkAutoLogin & "^*^" & _
                     StrChkOffLineLogin
        'Dim FilePath As String
        'GetSystemDirectory FilePath, 254
        'FilePath = Trim(FilePath) & "AABBAA.dat"
        FileNum = FreeFile
       ' Open FilePath For Binary As FileNum
       ' MsgBox App.Path
        Open App.Path & "\aa.dat" For Output As FileNum
        Print #FileNum, StrWriteIn
        Close #FileNum
    End If
    
End Sub

Private Sub Form_Load()
Dim TxtUserArry() As String
Dim TxtUserStru() As UserLoginInfo
ReDim TxtUserStru(1)
Dim TextLine As String
FileNum = FreeFile
Open App.Path & "\aa.dat" For Binary As #FileNum   ' 打开文件。
    Do While Not EOF(FileNum)   ' 循环至文件尾。
       
       Line Input #FileNum, TextLine   ' 读入一行数据并将其赋予某变量。
       If TextLine <> "" Then
        If Left(TextLine, 1) = """" Then TextLine = Mid(TextLine, 2)
        If Right(TextLine, 1) = """" Then TextLine = Mid(TextLine, 1, (Len(TextLine) - 1))
        TxtUserArry() = Split(TextLine, DELITE)
        ReDim Preserve TxtUserStru(UBound(TxtUserStru) + 1)
        TxtUserStru(UBound(TxtUserStru) + 1).LoginNum = TxtUserArry(0)
        TxtUserStru(UBound(TxtUserStru) + 1).Password = TxtUserArry(1)
        TxtUserStru(UBound(TxtUserStru) + 1).AutoLogin = TxtUserArry(2)
        TxtUserStru(UBound(TxtUserStru) + 1).offLineLogin = TxtUserArry(3)
        If TxtUserArry(0) <> "" Then
             CmbLoginNum.AddItem TxtUserArry(0)
        End If
       End If
       Debug.Print TextLine   ' 在立即窗口中显示数据。
    Loop
Close #1   ' 关闭文件
End Sub

Private Sub TxtPassword_KeyPress(KeyAscii As Integer)
    If KeyAscii = vbKeyReturn Then CmdLogin.SetFocus
End Sub

'Private Sub Command1_Click()
'    Dim Fn As Integer
'    Fn = FreeFile
'    Open App.Path & "\a.dat" For Output As Fn
'    Write #Fn, 32, 65, 565, 6565, fgdfg56, 656
'    Write #Fn, "dfgfg"; "fggggg", "sdfsdf", "sdfsdf"
'    Write #Fn, False, True
'    Write #Fn, sdlkjdfkl, sdlkfjlsdkfjlsdkf, lsdfj
'    Close #Fn
'End Sub

⌨️ 快捷键说明

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