module.bas
来自「动态更新自己的IP地址,使用www.3322.org动态域名服务,请看readm」· BAS 代码 · 共 42 行
BAS
42 行
Attribute VB_Name = "Module"
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Declare Function GetPrivateProfileString Lib "Kernel32" Alias "GetPrivateProfileStringA" (ByVal _
lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpRetunedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "Kernel32" Alias "WritePrivateProfileStringA" (ByVal _
lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Long
Function GetFromINI(AppName As String, KeyName As String, FileName As String) As String 'Get INI key value
Dim RetStr As String
RetStr = String(255, Chr(0))
GetFromINI = Left(RetStr, GetPrivateProfileString(AppName, ByVal KeyName, "", RetStr, Len(RetStr), FileName))
End Function
Public Function WriteINI(Section As String, key As String, Value As String, FileName) As Boolean
If WritePrivateProfileString(Section, key, Value, FileName) = 0 Then
WriteINI = False
Else
WriteINI = True
End If
End Function
Public Function ReturnVersion() As String
ReturnVersion = "DDNS Version 1.0.2"
End Function
Public Sub WriteLog(ErrorInfo As String)
ErrorInfo = WriteINI(ReturnVersion, CStr(Now), ErrorInfo, App.Path + "\" + CStr(Year(Now)) + _
CStr(Month(Now)) + CStr(Day(Now)) + ".log")
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?