注册 登录
编程论坛 VB6论坛

commondialog问题求助

新手编程者 发布于 2013-03-18 17:57, 373 次点击
我有一个数组,想通过commondialog.showsave  进行保存,  保存到txt文档中
例如:a(0 to 100)如何保存  
大虾们帮帮忙 最好把代码附带上,谢谢啦
1 回复
#2
xiaokiss20082013-03-18 18:24
程序代码:
Private Sub CmdSave_Click()
Dim a(0 To 100) As Long
Dim i As Integer
For i = 0 To 100
a(i) = i
Next i
  On Error Resume Next
  CdlTest.CancelError = True
  CdlTest.DialogTitle = "保存文件"
  CdlTest.FileName = ""
  CdlTest.Filter = "文本文件(*.txt)|*.txt"
  CdlTest.Flags = cdlOFNCreatePrompt + cdlOFNHideReadOnly
  CdlTest.ShowSave
  If Err = cdlCancel Then Exit Sub
  TextBoxSave.Text = CdlTest.FileName
  Open TextBoxSave For Output As #1
  For i = 0 To 100
  Write #1, a(i)
  Next i
  Close #1
End Sub
我也是初学,纠结了一段时间这个
1