var obj = new ActiveXObject("WScript.Shell")
obj.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue", "1", "REG_SZ")
document.writeln("Written successfully</br>")
var testValue = obj.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue")
document.writeln("Read successfully</br>")
document.writeln("The value of TestValue is "+testValue)
}
保存为js文件,在html文件中写入代码<script type="text/javascript">
function addItem() {
var obj = new ActiveXObject("WScript.Shell")
obj.RegWrite("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue", "1", "REG_SZ")
document.writeln("Written successfully</br>")
var testValue = obj.RegRead("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\TestValue")
document.writeln("Read successfully</br>")
document.writeln("The value of TestValue is "+testValue)
}
保存为js文件,在html文件中写入代码包含js文件,并且在body中<body onload="addItem()">就可以了
是啊,就像楼上那位仁兄所说,导航代码是有CSS做一些布局加javascript做一些效果,他们都是用外联的方式引用这些代码的,还有一些图片什么的如果将这个页面下载下来就会得到这个页面的代码和它所引用的脚步和图片这样就可以引用到你的页面里了。'引用Microsoft HTML Object Library库Private Sub Command1_Click()
Dim doc As New HTMLDocument
doc.body.innerHTML = Text1.Text '用HTMLDocument来解析网页文本
'获取select标签
Dim objSelect As HTMLSelectElement
Set objSelect = doc.getElementsByName("ctl00$MainContent$tabContainer$tbZFile$ucSeaExZDFileDetail$ddlDelTerm").Item(0)
Dim i As Integer
Dim objOption As HTMLOptionElement
For i = 0 To objSelect.length - 1 '检索Option对象
Set objOption = objSelect.Item(i)
List1.AddItem objOption.Text '添加到列表框中
Next
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)