| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1740 人关注过本帖
标题:怎么用createobject建立一个html对象
取消只看楼主 加入收藏
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
结帖率:96.72%
收藏
已结贴  问题点数:20 回复次数:7 
怎么用createobject建立一个html对象
如题。

忘了createobject怎么建立html dom 对象了。
搜索更多相关主题的帖子: html 对象 建立 
2022-02-04 12:25
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
回复 2楼 csyx
html 和xml应该不是同一个吧
2022-02-04 13:38
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
回复 4楼 吹水佬
谢谢吹水佬,那是不是html对象没法建立要自己写程序了?我记得有一个统一编程接口的(对所有编程语言),可以对html文件当成一个对象来处理的,用于html文件解析。

[此贴子已经被作者于2022-2-4 19:18编辑过]

2022-02-04 19:13
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
createobject大全
Server.CreateObject("Scripting.FileSystemObject")
Server.CreateObject("Scripting.Dictionary")    HashTable
Server.CreateXObject("Word.Application")     //Server
ActiveXObject("Word.Application")     //Client
Server.CreateObject("Excel.Application")    //Server
ActiveXObject("Excel.Application")     //Client
CreateObject("PowerPoint.Application")
Server.CreateObject("Microsoft.XMLHTTP")
Server.CreateObject("Microsoft.XMLDOM")
Server.CreateObject("MSXML2.XMLHTTP.4.0")
Server.CreateObject("WScript.Shell")
Server.CreateObject("whtm>ref=100.htm>)
Server.CreateObject("MSWC.AdRotator")
CreateObject("Excel.Sheet")
MS FrontPage: oFP = CreateObject("FrontPage.Application")
MS Access: oAccess = CreateObject("Access.Application")
MS Graph: oGraph = CreateObject("MSGraph.Application")
CreateObject("PhotoShop.Application")
CreateObject("SQLDMO.SQLServer")
CreateObject("SQLDMO.Login")
CreateObject("SQLDMO.Backup")
CreateObject("SQLDMO.User")
Server.CreateObject("SQLDMO.BackupDevice")
Server.CreateObject("SQLDMO.Database")
Server.CreateObject("SQLDMO.Restore")
Server.CreateObject("MSMQ.MSMQQueueInfo")
CreateObject("MSMQ.MSMQQuery")
Server.CreateObject("ixsso.Query")
Server.CreateObject("ixsso.Util")
AccPac Advantage Corporate:
oAccPac=CreateObject("ACCPAC.xapiSession")
AccPac Report Master for Windows:
oImpApp=CreateObject("Impromptu.Application.30")
BarTender:
oBarTender = CreateObject("BarTender.Application")
CrystalReports:
oCRApplication = createobject ("CrystalRuntime.Application")
This doesn’t invoke an IDE actually.
EUDORA:
oEud = CreateObject("Eudora.EuApplication.1")
FaxMaker:
oFax = CREATEOBJECT("fmfaxapi.application")
GroupWise:
oGroupWise = CreateObject("NovellGroupWareSession")
LotusNotes:
oNotes = CreateObject("Notes.NotesSession")
oNotes = CreateObject("Notes.NotesUIWorkspace")
oNotes = CreateObject("Lotus.Notessession") (Domino 5.0.3)
MS Common Dialog:
oCommmonDialog = CreateObject(") && !!! You can’t directly create this object without a development licence, so for dynamically doing it on another machine, see below. -- PeterCrabtree
MS Internet Explorer:
oIE = CreateObject("InternetExplorer.Application")
IEAutomationExample
MS MapPoint:
oMapPoint = CreateObject("MapPoint.Application")
MSN Messenger:
oMessenger = CREATEOBJECT("MSNMessenger.MessengerApp")
MS NetMeeting:
oNetMeeting=CREATEOBJECT("netmeeting.app.1")
MS Outlook:
oOutlook = CreateObject("Outlook.Application")
MS Outlook Express: None - It is not a COM server!
MS PowerPoint:
oPP = CreateObject("PowerPoint.Application")
MS Project:
oProj = CreateObject("msProject.Application")
MS SourceSafe:
oVSS = CreateObject("SourceSafe.0")
MS Word:
oWord = CreateObject("Word.Application")
MS Visio:
oVisio = CreateObject("Visio.Application")

MS VisualCPlusPlus: (VC++)
oCpp = CreateObject("MSDev.Application")
MS VisualFoxpro:
oVFP = CreateObject("VisualFoxPro.Application")
MS WindowsScriptingHost:
oWSH = CreateObject("WScript.Shell")
Novell GroupWise:
oGroupWise = CreateObject("NovellGroupWareSession")
PCAnywhere (host):
oPCAHost = CreateObject("WinAWSvr.BeHostDataManager")
PCAnywhere (remote):
oPCARem = CreateObject("WinAWSvr.RemoteDataManager")
QuickBooks:
QBSessionManager = CreateObject("QBFC2.QBSessionManager")
RationalRose:
oRose = CreateObject("Rose.Application")
TAPIFax:
oTAPIFax = CreateObject(’FaxServer.FaxServer’)
WindowsShell:
oWSH = CreateObject("Shell.Application")
Windows Media Player:
oWMP = CREATEOBJECT("WMPlayer.OCX")
oPlayList = oWmp.PlaylistCollection.GetAll()
oWmp.currentPlaylist = oPlayList.Item(0) && Zero based array
*!* Music starts!
Windows Messenger:
oMessenger = CREATEOBJECT("Messenger.MessengerApp")
WinFax:
oWinFax = CreateObject("WinFax.SDKSend")
WinPrint :
oWinPrint = CreateObject("WinPrint.WinPrintX")
SQL-DMO object:
loSQL = CREATEOBJECT("SQLDMO.Application")
Others:
Scripting Shell:
oShell = CreateObject("WScript.Shell")
Scripting Network Object:
oNet = CreateObject(")
Scripting Regular Expression Parser:
oReg = CreateObject("VBScript.RegExp")
SQL DMO SQL Server:
CreateObject("SQLDMO.SQLServer")

居然没有。。。
2022-02-04 19:32
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
回复 6楼 吹水佬
谢谢吹水佬,我也是闲着没事,被隔离,哈哈。

看了加菲猫的一些技术文章,想自己试试。
2022-02-04 19:38
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
回复 9楼 吹水佬
这个是打开一个浏览器
2022-02-04 22:36
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
lchtml=filetostr("zipper.html")
oxml=NEWOBJECT('microsoft.xmldom')
?oxml.loadXML(lchtml) && 显示是.f.

下面是zipper.html的内容
<html>
<head>这是我的第一个文件!
<title>
</title>
</head>
<body bgcolor="silver">
<table id="GenTable" border=1>
<tr>
<th>供应商</th>
<th>型号</th>
<th>材质</th>
<th>功能</th>
<th>拉头</th>
<th>基本长度</th>
<th>基本价</th>
<th>加1cm</th>
<th>减1cm</th>
<th>备注</th>
</tr>
<tr>
<td>红彩翔</td>
<td>3</td>
<td>尼龙</td>
<td>闭口</td>
<td>普通</td>
<td>18</td>
<td>0.210</td>
<td>0.005</td>
<td>0.003</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>5</td>
<td>尼龙</td>
<td>闭口</td>
<td>普通</td>
<td>18</td>
<td>0.350</td>
<td>0.006</td>
<td>0.005</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>5</td>
<td>尼龙</td>
<td>防水</td>
<td>普通</td>
<td>18</td>
<td>0.770</td>
<td>0.020</td>
<td>0.020</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>5</td>
<td>尼龙</td>
<td>开口</td>
<td>普通</td>
<td>60</td>
<td>0.770</td>
<td>0.006</td>
<td>0.005</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>5</td>
<td>树脂</td>
<td>闭口</td>
<td>普通</td>
<td>18</td>
<td>0.460</td>
<td>0.010</td>
<td>0.010</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>5</td>
<td>树脂</td>
<td>开口</td>
<td>普通</td>
<td>60</td>
<td>0.960</td>
<td>0.010</td>
<td>0.010</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>8</td>
<td>树脂</td>
<td>闭口</td>
<td>普通</td>
<td>18</td>
<td>0.990</td>
<td>0.014</td>
<td>0.014</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>红彩翔</td>
<td>8</td>
<td>树脂</td>
<td>开口</td>
<td>普通</td>
<td>60</td>
<td>1.800</td>
<td>0.020</td>
<td>0.020</td>
<td>&nbsp;</td>
</tr>

</table>
</body>
</html>
2022-02-04 22:43
sam_jiang
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:14
帖 子:789
专家分:1165
注 册:2021-10-13
收藏
得分:0 
貌似里面有中文字符的原因。

ohttp=newobject("microsoft.xmlhttp")
ohttp.open("get","http://localhost/practice/zipper.html")
ohttp.send()
?ohttp.responsetext && 成功获得含中文html文本内容
oxml=newobject("microsoft.xmldom")
oxml.load(ohttp.responsetext)
?oxml.haschildnodes && 依然返回.f.

把上面的zipper.html 换成一个英文的页面myupload.html就可以返回.t.

ohttp.open("get","http://localhost/practice/myupload.html")
ohttp.send()
?ohttp.responsetext && 成功获得含html文本内容
oxml=newobject("microsoft.xmldom")
oxml.load(ohttp.responsetext)
?oxml.haschildnodes && 返回.t.
?oxml.nodename &&返回 #document
?oxml.documentElement.childNodes(0).nodeName && 返回body
?oxml.documentElement.childNodes(0).childnodes(0).nodeName && 返回form
?oxml.documentElement.childNodes(0).childnodes(0).childnodes(0).nodeName && 返回label
?oxml.documentElement.childNodes(0).childnodes(0).childnodes(1).nodeName && 返回input
?oxml.documentElement.childNodes(0).childnodes(0).childnodes(2).nodeName && 返回br
?oxml.documentElement.childNodes(0).childnodes(0).childnodes(3).nodeName && 返回input

以下是myupload.html的内容,返回结果如预期。
<!DOCTYPE html>
<html lang=“zh-CN”>
<body>

<form action="upload_file.php" method="post"
enctype=" multipart/form-data">
<label for="file">Filename:</label>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>

</body>
</html>

这个中文字符问题该怎么解决呢???

[此贴子已经被作者于2022-2-5 12:39编辑过]

2022-02-05 12:28
快速回复:怎么用createobject建立一个html对象
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.034318 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved