📄 ini.bas
字号:
Attribute VB_Name = "Ini"
Option Explicit
Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nsize As Long, ByVal lpFileName As String) As Long
Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Boolean
Public FileIni As String
Public Sub Main()
frmMAIN.Show
frmSplash.Show
PouseDoEvent (1000)
frmSplash.Hide
End Sub
Public Sub PouseDoEvent(ByVal num As Long)
Dim start As Long
start = GetTickCount
While GetTickCount < (start + num)
DoEvents
Wend
End Sub
Public Function get_ini() As Boolean
Dim str As String
Dim i As Integer
Dim v_ret As String
Dim nsize As Long
Dim ccc_g As String
On Error GoTo gest
FileIni = App.Path + "\panther.ini"
v_ret = Space$(255)
nsize = 255
str = GetPrivateProfileString("pink panther", "DO NOT TOUCH", "", v_ret, nsize, FileIni)
ccc_g = Trim(Left$(v_ret, InStr(v_ret, Chr$(0)) - 1))
If ccc_g <> "REGISTER" Then
get_ini = False
Exit Function
End If
v_ret = Space$(255)
nsize = 255
str = GetPrivateProfileString("FILEPATH", "ONOPEN", "", v_ret, nsize, FileIni)
fpath = (Left$(v_ret, InStr(v_ret, Chr$(0)) - 1)) 'Trim
get_ini = True
Exit Function
gest:
MsgBox Err.Description
get_ini = False
End Function
Public Function set_ini() As Boolean
Dim str As String
Dim i As Integer
On Error GoTo gest
set_ini = False
FileIni = App.Path + "\panther.ini"
str = WritePrivateProfileString("pink panther", "NE DIRAJ", "REGISTER", FileIni)
str = WritePrivateProfileString("FILEPATH", "ONOPEN", fpath, FileIni)
set_ini = True
Exit Function
gest:
MsgBox Err.Description
End Function
Public Sub Center(f As Form)
f.Move (Screen.Width - f.Width) / 2, (Screen.Height - f.Height) / 2
End Sub
Public Function ParseName(ByVal str As String) As String
Dim i As Integer
For i = Len(str) To 1 Step -1
If Mid(str, i, 1) = "\" Then
ParseName = Mid(str, i + 1, Len(str) - i)
Exit Function
End If
Next i
ParseName = ""
End Function
Public Function ParseFolder(ByVal str As String) As String
Dim i As Integer
For i = Len(str) To 1 Step -1
If Mid(str, i, 1) = "\" Then
ParseFolder = Mid(str, 1, i)
Exit Function
End If
Next i
ParseFolder = ""
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -