VB listbox 保存成txt文件
有大神能写段用commondialog.showsave然后保存list里面的所以item到text文件么?...
有大神能写段用 commondialog.showsave然后保存list里面的所以item到text文件么?
展开
展开全部
Private Sub Command1_Click()
Open App.Path & "\1.txt" For Output As #1
For i = 0 To File1.ListCount - 1
Print #1, Left(File1.List(i), Len(File1.List(i)) - 4)
Next i
Close
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
File1.Pattern = "*.jpg"
End Sub
Open App.Path & "\1.txt" For Output As #1
For i = 0 To File1.ListCount - 1
Print #1, Left(File1.List(i), Len(File1.List(i)) - 4)
Next i
Close
End Sub
Private Sub Dir1_Change()
File1.Path = Dir1.Path
End Sub
Private Sub Drive1_Change()
Dir1.Path = Drive1.Drive
End Sub
Private Sub Form_Load()
File1.Pattern = "*.jpg"
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询