一般在ASP中调用VB组件时要用到
 Set obj=server.createobject("工程名.类名")来创建实例
可是我今天却看到一个程序
  Response.Output Document.Item(“name”)这样直接用上去了,根本没有用到server.createobject来创建对象,这个调用的直接结果就是输出字段名为name的值,也就是说,Document相当于response,request一样的,变成了ASP内置对象,请问这个是怎么实现的?再描述清楚点:
Response.Output Document.Item(“name”)
这句话可以直接在ASP中调用,无需用server.createobject创建对象
也就是说,如何可以使Document变成ASP的内置对象兄弟们帮我!!!!

解决方案 »

  1.   

    Response.Output   ??你确认这是ASP不是ASP.NET ?
      

  2.   

    MSDN中response对象只有以下的方法:
    AddHeader 
    AppendToLog 
    BinaryWrite 
    Clear 
    End 
    Flush 
    Redirect 
    Write
      

  3.   

    呃,是ASP,我说过了,那个组件是自己开发的。
    如果这样
    set Objtt=server.createobject("工程名.类名")
    Objtt.Output "这是测试"
    这样可以实现,没错吧、同理
    我们一般要调用VB程序里
    一般需要在调用前创建这个DLL实例

    Set obj=server.createobject("工程名.类名")
    tmp=Document.Item(“name”)但是现在,我看到的是Docment是作为一个ASP的内置对象来的,也就是说,在页面中只要这样
    tmp=Document.Item(“name”)
    就可以取出name 的值来,不需要在ASP网页中还要创建Set obj=server.createobject("工程名.类名")这句了请问这是怎么实现?
      

  4.   

    不一定后缀是asp的就是asp了,单这个文件你在其他机器上面运行没有问题吗?因为如果不是内置对象的话,肯定是需要注册或者创建才可以调用,它有可能是在其他的include文件中包含的。
      

  5.   

    asp3里response没有Output,你写的根本就不是asp3的东西Response.Output Document.Item(“name”) 我可以把你说的做成这个样子的response.write document.item("name")这个倒不难,根本不用创建要多做个类就可以达到同样的效果比如
    class xxx
    set item=server.createobject("scripting.dictionary")
     Private Sub Class_Initialize
             item.add "name","ttt"
       End Sub
    end class
    set document=new xxx
    response.write document.item("name")
      

  6.   

    asp3里response没有Output,你写的根本就不是asp3的东西Response.Output Document.Item(“name”) 我可以把你说的做成这个样子的response.write document.item("name")这个倒不难,根本不用创建要多做个类就可以达到同样的效果比如
    class xxx
    set item=server.createobject("scripting.dictionary")
     Private Sub Class_Initialize
             item.add "name","ttt"
       End Sub
    end class
    set document=new xxx
    response.write document.item("name")
      

  7.   

    asp3里response没有Output,你写的根本就不是asp3的东西Response.Output Document.Item(“name”) 我可以把你说的做成这个样子的response.write document.item("name")这个倒不难,根本不用创建要多做个类就可以达到同样的效果比如
    class xxx
    set item=server.createobject("scripting.dictionary")
     Private Sub Class_Initialize
             item.add "name","ttt"
       End Sub
    end class
    set document=new xxx
    response.write document.item("name")
      

  8.   

    呃,是不是我表达的不够清楚55555555555555
    各位理解错了,自己写一个VB组件,很容易的就可以把原先ASP里的response.write 变成自己想要的response.output是吧?
    我现在说的关键不在这里。是在Document.Item(“name”)这一句
    这句话按常理,需要用到Document对象的话
    我们必须在Document.Item(“name”)这句话前加一句set Document=server.createobject("工程名。类名")这样的创建对象才可以使用Document对象
    可是我看到的这代码就单单Document.Item(“name”),没有创建对象这一步,当然也没有什么包含文件什么的了,而且对方给的说明文档里也说Document是内置对象,在使用时无需重新创建对象,像response对象一样,在ASP里调用,直接写Document.Item(“name”)就可以了,比如
    <%
    response.write Document.Item("name")
    %>
    这个是怎么实现的,把Docment变成ASP内置对象?
      

  9.   

    都跟你说了这个怎么变,你看不懂的??我晕,我写的就是个asp页啊
    <%
    class xxx
    set item=server.createobject("scripting.dictionary")
     Private Sub Class_Initialize
             item.add "name","ttt"
       End Sub
    end class
    set document=new xxx
    response.write document.item("name")
    %>
      

  10.   

    '上面有点小错误
    <%
    class xxx
     dim item
     Private Sub Class_Initialize
             set item=server.createobject("scripting.dictionary")         item.add "name","ttt"
       End Sub
    end class
    set document=new xxx
    response.write document.item("name")
    %>
      

  11.   

    to:回复人: liuxiaoyi666(兔子) ( ) 信誉:106 你说这个是一个ASP写的类,不是VB组件。。我说的是document定义在组件里,ASP页面里只有一行代码:document.item("name")唉,算了,可能是我表达不清。。结分了