let 是设置属性,get是获取属性 set也是设置属性 let用来设置变量属性,set用来设置对象变量属性主要用来保护变量的,如有一个Form,不想其变量被其它Form直接访问,则可以不必定义为public ,这时用属性定实现比较适合
class xmlhttprequest dim xmlhttp1 dim blogdom Private Sub Class_Initialize set xmlhttp1 = CreateObject("Microsoft.XMLHTTP") set blogdom=createobject("Microsoft.XMLDOM") end sub Public function opensend(xmlurl,xslurl)-------改成property let之后 xmlhttp1.open "GET",xmlurl,false xmlhttp1.send() blogdom.async=false blogdom.load xslurl end function public function show() set text2 = xmlhttp1.responseXML text2.loadXML xmlhttp1.responseText set blogxml=text2.documentElement set blogroot=blogxml.selectSingleNode("//blog") show=blogroot.transformNode(blogdom) end function end classset xmlhttp2=new xmlhttprequest xmlhttp2.opensend filename,filename1--------->提示无属性
let不一定要有get
let用来设置变量属性,set用来设置对象变量属性主要用来保护变量的,如有一个Form,不想其变量被其它Form直接访问,则可以不必定义为public ,这时用属性定实现比较适合
dim xmlhttp1
dim blogdom
Private Sub Class_Initialize
set xmlhttp1 = CreateObject("Microsoft.XMLHTTP")
set blogdom=createobject("Microsoft.XMLDOM")
end sub
Public function opensend(xmlurl,xslurl)-------改成property let之后
xmlhttp1.open "GET",xmlurl,false
xmlhttp1.send()
blogdom.async=false
blogdom.load xslurl
end function
public function show()
set text2 = xmlhttp1.responseXML
text2.loadXML xmlhttp1.responseText
set blogxml=text2.documentElement
set blogroot=blogxml.selectSingleNode("//blog")
show=blogroot.transformNode(blogdom)
end function
end classset xmlhttp2=new xmlhttprequest
xmlhttp2.opensend filename,filename1--------->提示无属性