在VB中creatfile函数为什么不能用?怎么声明?急!!!!

解决方案 »

  1.   

    dim objfso as object
    set objfso=createobject("scripting.filesystemobject")
    objfso.createfile "c:\a.txt"
      

  2.   

    楼上的是利用文件对象实现的
    楼主说得createfile是API函数
    但是我测试的时候,这个函数有一个参数是一个结构该如何调用呢?
      

  3.   

    Private Declare Function CreateFile Lib "kernel32" Alias "CreateFileA" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, lpSecurityAttributes As SECURITY_ATTRIBUTES, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
    是API函数,要声明的
      

  4.   

    dim objfso as object
    set objfso=createobject("scripting.filesystemobject")
    objfso.createfile "c:\a.txt"
            ~~~~~~~~~CreateTextFile
      

  5.   

    声明之后也还是不能直接用啊
    我试过拉,参数中lpSecurityAttributes As SECURITY_ATTRIBUTES
    这里会提示错误的