关于VB保存text中的信息
来源:百度知道 编辑:UC知道 时间:2024/05/17 22:22:24
Private Declare Function SHGetSpecialFolderLocation Lib "Shell32" (ByVal hwndOwner As Long, ByVal nFolder As Integer, ppidl As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "Shell32" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal szPath As String) As Long
Private Function APIGet(Code As Integer) As String
Dim sTmp As String * 200
Dim nLength As Long
Dim pidl As Long
SHGetSpecialFolderLocation 0, Code, pidl
SHGetPathFromIDList pidl, sTmp
APIGet = Left(sTmp, InStr(sTmp, Chr(0)) - 1)
End Function
Public Function DeskTop() As String
DeskTop = APIGet(&H0&)
End Function
Private Sub Command1_Click()
open desktop & "\" & text1.text & ".txt" for output as #1
print #1,text1
print #1,text2
print #1,text3
close #1
End Sub
问题真多~还得继续努力!!