Open PaFi For Random As #1
Input #1, ll
MsgBox ll
Close #1

解决方案 »

  1.   


    Open PaFi For Input As #1
    Input #1, ll
    MsgBox ll
    Close #1
      

  2.   

    PaFi是什么?
    debug.print PaFi看看
      

  3.   

    问题一定出在PaFi上。贴出来see see?
      

  4.   

    Option Explicit
    Dim i As Long
    Private Sub CommandBar1_ButtonClick(ByVal Button As CommandbarLib.CommandBarButton)End SubPrivate Sub Form_Load()
    Me.Width = Screen.Width - 20
    Me.Height = Screen.Height - 40
    Me.Top = 5
    Me.Left = 5
     i = L1.ListItems.Add(1, "a", "打开")
     L1.ListItems.Add 2, "b", "关闭"
     End SubPrivate Sub L1_AfterLabelEdit(Cancel As Boolean, ByVal NewString As String)End SubPrivate Sub L1_ColumnClick(ByVal Index As Long)
    If Index = 1 Then
    MsgBox "打开"
    End If
    End SubPrivate Sub L1_ItemClick(ByVal Index As Long)
    Dim ll As String
    Dim PaFi As String
    If Index = 1 Then
    CD1.Filter = "*.txt"
    i = CD1.ShowOpen
    PaFi = CD1.FileName
    Text1.Text = ""
    Text1.Width = L1.Width
    Text1.Height = L1.Height
    L1.Visible = FalseOpen PaFi For Random As #1
    Input #1, ll
    MsgBox ll
    Close all
    End If
    End Sub
    窗体上有个commondialog叫cd1
    有个listviewctrl叫l1
      

  5.   

    不知道你的错误出在哪。下面对文件的读取操作没有问题。Open PaFi For Input As #1
         Input #1, ll
         MsgBox ll
    Close #1
      

  6.   

    ll是listview?那么input后面要输入什么?应该是ll.selecteditem.text吧?