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

📄 form1.frm

📁 一个可以让VB也支持序列化文件的DLL代码。
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   4875
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   4875
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command4 
      Caption         =   "Command4"
      Height          =   255
      Left            =   1680
      TabIndex        =   13
      Top             =   3240
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Command3"
      Height          =   255
      Left            =   1680
      TabIndex        =   12
      Top             =   1560
      Width           =   1455
   End
   Begin VB.TextBox Text10 
      Height          =   270
      Left            =   240
      TabIndex        =   11
      Top             =   4320
      Width           =   1215
   End
   Begin VB.TextBox Text9 
      Height          =   270
      Left            =   240
      TabIndex        =   10
      Top             =   3960
      Width           =   1215
   End
   Begin VB.TextBox Text8 
      Height          =   270
      Left            =   240
      TabIndex        =   9
      Top             =   3600
      Width           =   1215
   End
   Begin VB.TextBox Text7 
      Height          =   270
      Left            =   240
      TabIndex        =   8
      Top             =   3240
      Width           =   1215
   End
   Begin VB.TextBox Text6 
      Height          =   270
      Left            =   240
      TabIndex        =   7
      Top             =   2640
      Width           =   1215
   End
   Begin VB.TextBox Text5 
      Height          =   270
      Left            =   240
      TabIndex        =   6
      Top             =   2280
      Width           =   1215
   End
   Begin VB.TextBox Text4 
      Height          =   270
      Left            =   240
      TabIndex        =   5
      Top             =   1920
      Width           =   1215
   End
   Begin VB.TextBox Text3 
      Height          =   270
      Left            =   240
      TabIndex        =   4
      Top             =   1560
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Command2"
      Height          =   255
      Left            =   1680
      TabIndex        =   3
      Top             =   840
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   270
      Left            =   240
      TabIndex        =   2
      Top             =   840
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   255
      Left            =   1680
      TabIndex        =   1
      Top             =   360
      Width           =   855
   End
   Begin VB.TextBox Text1 
      Height          =   270
      Left            =   240
      TabIndex        =   0
      Top             =   360
      Width           =   1215
   End
   Begin VB.Line Line1 
      X1              =   120
      X2              =   4560
      Y1              =   1320
      Y2              =   1320
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Type CFileinfoio
     CountInfo As Long
     UserName As String
     Email As String
     AddRess As String
End Type
Private Declare Function SetLoadInfo Lib "文件序列化DLL.dll" (CountInfo As Long, ByVal UserName As String, ByVal Email As String, ByVal AddRess As String) As String
'Private Declare Function GetLoadInfo Lib "文件序列化DLL.dll" (CountInfo As Long, ByVal UserName As String, ByVal Email As String, ByVal AddRess As String) As String
Private Declare Function GetLoadInfo Lib "文件序列化DLL.dll" () As Long
Private Declare Function SetData Lib "文件序列化DLL.dll" (ByVal s As String)
Private Declare Function GetData Lib "文件序列化DLL.dll" () As String


Private Sub Command1_Click()

SetData Text1.Text, Text2.Text
End Sub

Private Sub Command2_Click()
 Text2.Text = GetData
End Sub

Private Sub Command3_Click()
Dim s As CFileinfoio
s.UserName = Text4.Text
s.Email = Text5.Text
s.CountInfo = Text3.Text
s.AddRess = Text6.Text
MsgBox SetLoadInfo(CLng(Text3.Text), Text4.Text, Text5.Text, Text6.Text)
End Sub

Private Sub Command4_Click()
Dim CountInfo As Long
Dim UserName As String
Dim Email As String
Dim AddRess As String
'MsgBox GetLoadInfo(CountInfo, UserName, Email, AddRess)
MsgBox GetLoadInfo()
Text7.Text = CountInfo
Text8.Text = UserName
Text9.Text = Email
Text10.Text = AddRess
End Sub

⌨️ 快捷键说明

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