如果可以,请问如何存取?  
谢谢了!!  
试了一下,不知为什么open不好用。  

解决方案 »

  1.   

    Sub OpenTextFileTest
        Const ForReading = 1, ForWriting = 2, ForAppending = 3
        Dim fs, f
        Set fs = CreateObject("Scripting.FileSystemObject")
        Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending,TristateFalse)
        f.Write "Hello world!"
        f.Close
    End Sub
      

  2.   

    或者引用 microsoft scripting runtimeOption ExplicitPrivate Sub Form_Load()
        Const ForReading = 1, ForWriting = 2, ForAppending = 8
        Dim fs As New FileSystemObject
        Dim f As TextStream
        Set f = fs.OpenTextFile("c:\testfile.txt", ForAppending, True, TristateFalse)
        f.Write "Hello world!"
        f.Close
    End Sub
      

  3.   

    Class blogfso
     dim fso
    Private Sub Class_Initialize
    set fso=createobject("scripting.filesystemobject")
    end sub
    function fsocreatetextfile(filename)
    set fsocreatetext=fso.CreateTextFile(filename, true, false)
    end function
    function fsowrite(blogtitlevalue,blogcontentvalue,filename)
         set fsofile=fso.getfile(filename)
         set fsoopentextfile=fsofile.OpenAsTextStream(8, false)
         xmlstr="<?xml version='1.0'?>"
         xmlstr=xmlstr&"<blog>"
         xmlstr=xmlstr&"<blogtitle>"
         xmlstr=xmlstr&blogtitlevalue
         xmlstr=xmlstr&"</blogtitle>"
         xmlstr=xmlstr&"<blogcontent>"
         xmlstr=xmlstr&blogcontentvalue
         xmlstr=xmlstr&"</blogcontent>"
         xmlstr=xmlstr&"</blog>"
    fsoopentextfile.write xmlstr
    end function
    Private Sub Class_Terminate
      set fso=nothing
     End Sub
     End Classvbs 写的
      

  4.   

    Option ExplicitPrivate Sub Form_Load()
    Dim oFSO As FileSystemObject
    Dim oTextStream As TextStream
    Dim oFirstLine As String
    Dim i, LineNum As Integer
    Set oFSO = CreateObject("scripting.filesystemobject")
    Set oTextStream = oFSO.OpenTextFile("c:\aa.txt", ForAppending, False, TristateFalse)
    oTextStream.Write (vbCrLf & "这是一个新增的测试行")'以下为删除某一行,如第二行
    oTextStream.Close
    Set oTextStream = oFSO.OpenTextFile("c:\aa.txt", ForReading, False, TristateFalse)
    Dim str(1000) As String        '这里根据实际情况可增大或缩小数组的维数
    i = 0
    Do While oTextStream.AtEndOfLine <> True
        str(i) = oTextStream.ReadLine
        i = i + 1
    Loop
    LineNum = i
    oTextStream.Close
    Set oTextStream = oFSO.OpenTextFile("c:\aa.txt", ForWriting, False, TristateFalse)
    oTextStream.Write str(0)
    For i = 1 To LineNum - 1
       If i <> 1 Then
          oTextStream.Write vbCrLf & str(i)
       End If
    Next i
    oTextStream.Close
    Set oFSO = Nothing
    End Sub
      

  5.   

    我指的是用vbscript控件写,不是直接用vb写。
    好象以上的代码中并没有出现vbscript控件的代码,如scriptcontrol1.addcode或scriptcontrol1.ExecuteStatement等代码哦。。
      

  6.   

    菜单"工程/引用/Microsoft Script Control 1.0"Private Sub Command1_Click()
        Dim evals As New ScriptControl
        
        evals.Language = "VBScript"
        MsgBox evals.Eval("(2+3)+3*4")
    End Sub
      

  7.   

    http://expert.csdn.net/Expert/topic/1629/1629637.xml?temp=.3973657
      

  8.   


    不是吧??
    有vbscript控件又没文件操作了??
    如果实在实现不了,有没有什么办法用vbscript控件在picture或form中画线呢?
      

  9.   

    或者其他将vbscript控件处理后的大量数据传出来的方法也可以。