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

📄 frmsetinfo.frm

📁 类似QQ的即时聊天系统,支持用户注册,源码分为客户端和服务器端。
💻 FRM
字号:
VERSION 5.00
Object = "{3B7C8863-D78F-101B-B9B5-04021C009402}#1.2#0"; "richtx32.ocx"
Begin VB.Form frmSetInfo 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "设置信息"
   ClientHeight    =   3270
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   3750
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3270
   ScaleWidth      =   3750
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "保存(&S)"
      Height          =   375
      Left            =   2160
      TabIndex        =   7
      Top             =   2280
      Width           =   1335
   End
   Begin VB.TextBox Text4 
      Height          =   285
      Left            =   240
      TabIndex        =   5
      Top             =   2760
      Width           =   3255
   End
   Begin VB.TextBox Text3 
      Height          =   285
      Left            =   240
      TabIndex        =   4
      Top             =   2160
      Width           =   495
   End
   Begin VB.TextBox Text2 
      Height          =   285
      Left            =   240
      TabIndex        =   3
      Top             =   1560
      Width           =   1815
   End
   Begin VB.OptionButton Option2 
      Caption         =   "女"
      Height          =   255
      Left            =   240
      TabIndex        =   2
      Top             =   1080
      Width           =   1215
   End
   Begin VB.OptionButton Option1 
      Caption         =   "男"
      Height          =   255
      Left            =   240
      TabIndex        =   1
      Top             =   840
      Value           =   -1  'True
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   285
      Left            =   240
      TabIndex        =   0
      Top             =   480
      Width           =   1815
   End
   Begin RichTextLib.RichTextBox RichTextBox1 
      Height          =   1695
      Left            =   2160
      TabIndex        =   6
      Top             =   480
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   2990
      _Version        =   393217
      ScrollBars      =   2
      MaxLength       =   400
      TextRTF         =   $"frmSetInfo.frx":0000
   End
   Begin VB.Label Label5 
      Caption         =   "关于"
      Height          =   255
      Left            =   2160
      TabIndex        =   12
      Top             =   240
      Width           =   1215
   End
   Begin VB.Label Label4 
      Caption         =   "主页地址"
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   2520
      Width           =   1215
   End
   Begin VB.Label Label3 
      Caption         =   "年龄"
      Height          =   255
      Left            =   240
      TabIndex        =   10
      Top             =   1920
      Width           =   1215
   End
   Begin VB.Label Label2 
      Caption         =   "出生日期"
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   1320
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "国家"
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   240
      Width           =   1215
   End
End
Attribute VB_Name = "frmSetInfo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'==================
'设置用户信息窗体
'==================

'=================
'保存用户信息
'=================
Private Sub Command1_Click()
    Dim Sex As String
    
    '性别
    If Option1.value = True Then
        Sex = "Male"
    Else
        Sex = "Female"
    End If
    If Text1.Text = "" Then   '国家
        Text1.Text = "N/A"
    End If
    If Text2.Text = "" Then   '出生日期
        Text2.Text = "N/A"
    End If
    If Text3.Text = "" Then   '年龄
        Text3.Text = "N/A"
    End If
    If Text4.Text = "" Then   '主页地址
        Text4.Text = "N/A"
    End If
    If RichTextBox1.Text = "" Then    '用户自述
        RichTextBox1.Text = "N/A"
    End If
    Dim Temp4 As String
    
    '替换用户自述中的回车符
    Temp4 = Replace(RichTextBox1.Text, vbCrLf, "//crlf\\")
    '保存信息
    MyPersonalInfo.Sex = Sex
    MyPersonalInfo.Country = Text1.Text
    MyPersonalInfo.BirthDay = Text2.Text
    MyPersonalInfo.Age = Text3.Text
    MyPersonalInfo.Webpage = Text4.Text
    MyPersonalInfo.About = Temp4
    '保存信息到文件info.dat
    Open "Info.dat" For Random As gFileNum Len = Len(MyPersonalInfo)
        Put #gFileNum, 1, MyPersonalInfo
    Close #gFileNum
    '发送SOCKET消息到服务器
    MyIM.Winsock1.SendData ".SaveInfo " & Connect.Text1.Text & " " & Sex & " " & Text1.Text & " " & Text2.Text & " " & Text3.Text & " " & Text4.Text & " " & Temp4
    '隐藏窗体
    Me.Hide
End Sub

'=================
'窗体启动过程
'=================
Private Sub Form_Load()
    gFileNum = FreeFile   '分配文件号
End Sub

⌨️ 快捷键说明

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