我要一些可以用的VB源码!
有的发到我邮箱!
237227038@qq.com
好的话加分!
我要一些可以用的VB源码!
有的发到我邮箱!
237227038@qq.com
好的话加分!
657668816@QQ.COM
请注意查收
If Dir(Environ("userprofile") & "\桌面\" & "腾讯QQ.lnk") <> "" Then Print "文件存在" Else Print "文件不存在" End If
'------------------------------
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString 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 lpFileName As String) As Long Private Sub Command1_Click() '读 ini 文件 Dim F As String, nStr As String, nSize As Long, S As Long F = "d:\optionv5.ini" F = App.Path & "\optionv5.ini" nSize = 255: nStr = String(nSize, 0) dl = GetPrivateProfileString("Option", "FilterUrl", "", nStr, nSize, F) S = InStr(nStr, Chr(0)) If S > 0 Then nStr = Left(nStr, S - 1) MsgBox "读出为:" & nStr '字符串 nStr 就是读出的等号后的内容 End Sub Private Sub Command2_Click() '写 ini 文件 Dim F As String F = "C:My.ini" dl = WritePrivateProfileString("AAA", "BBB", "CCC", F) If dl <> 0 Then MsgBox "写 ini 文件成功" End Sub
'--------------------------------------------
Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoDrag Me '可以当标题栏拖动 End Sub
Public Sub DoDrag(TheForm As Form) If TheForm.WindowState <> vbMaximized Then ReleaseCapture SendMessage TheForm.hwnd, &HA1, 2, 0& End If End Sub
'--------------------------------------
Text1.SelStart = 0 Text1.SelLength = Len(Text1.Text)