📄 module1.bas
字号:
Attribute VB_Name = "Module1"
Type student '定义类型
ipw As String '远程主机的互连网ip地址
ipn As String '远程主机的内网ip地址
name As String '远程主机的名子
tim As String '登录时间
tmpinformation As String
tmpheader As String
tmpremains As String
mconnected As Boolean '是否在连接
tmpsz As Variant '临时数组
'tmpbj As String '用来暂时保存所有的班级
'tmpkc As String '用来暂时保存所有的课程
srs As ADODB.Recordset
'tmpxh As Integer '用来暂时保存学生学号
End Type
Public Const maxconnect = 100 '定义可登录的最大玩家人数
Public wsocknum As Integer '定义记录已经加载的winsock空件数
Public muser(0 To maxconnect) As student '定义一个数组
Public conn As ADODB.Connection
'Public connop As Boolean '标志conn是否打开
Public tmpbj As String '用来暂时保存所有的班级
Public tmpkc As String '用来暂时保存所有的课程
Public clickflg As Boolean '标志排列
'连接字符串
Public connstr As String 'connstr = "provider=microsoft.jet.oledb.4.0; jet oledb:database password=office;data source=" & App.Path & "\db.mdb"
'---------------处理注册表的函数-----------------------
Public Declare Function RegCreateKey& Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey&, ByVal lpszSubKey$, lphKey&)
Public Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long
Public Const HKEY_LOCAL_MACHINE = &H80000002
Public Const REG_SZ = 1
'Public username As String '当前登录的用户
Public Sub connected()
Set conn = New ADODB.Connection
'Set conn = CreateObject("ADODB.Connection")
'connectstr = "provider=microsoft.jet.oledb.4.0; jet oledb:database password=server;data source=" & Mid(App.Path, 1, InStr(1, App.Path, "\服务器端") - 1) & "\客户端\data\kaoshi.mdb"
connectstr = "provider=microsoft.jet.oledb.4.0; jet oledb:database password=office;data source=" & App.Path & "\db.mdb"
conn.Open connectstr
connop = True
End Sub
Public Sub connclosed()
conn.Close
Set conn = Nothing
connop = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -