html是什么意思?和com、cn、net、格式区别在哪?

html是什么意思?和com、cn、net、格式区别在哪?,第1张

HTML(HyperTextMark-upLanguage)即超文本标记语言或超文本链接标示语言,是目前网络上应用最为广泛的语言,也是构成网页文档的主要语言。设计HTML语言的目的是为了能把存放在一台电脑中的文本或图形与另一台电脑中的文本或图形方便地联系在一起,形成有机的整体,人们不用考虑具体信息是在当前电脑上还是在网络的其它电脑上。我们只需使用鼠标在某一文档中点取一个图标,Internet就会马上转到与此图标相关的内容上去,而这些信息可能存放在网络的另一台电脑中。 HTML文本是由HTML命令组成的描述性文本,HTML命令可以说明文字、图形、动画、声音、表格、链接等。HTML的结构包括头部(Head)、主体(Body)两大部分,其中头部描述浏览器所需的信息,而主体则包含所要说明的具体内容。

com是公司的缩写,cn是中国域名的缩写,net是网页的缩写

1、ASP文件中的代码

pencat=rs.Fields.Item("m_content").Value

pencat=replace(pencat,"t_title",n_title)

pencat=replace(pencat,"t_author",n_author)

pencat=replace(pencat,"t_content",n_content)

Set fso = Server.CreateObject("Scripting.FileSystemObject")

Set fout = fso.CreateTextFile(server.mappath(fpath&"\" &fname))

fout.WriteLine pencat

fout.close

2、如下给出要生成的网页模板:

<html>

<head>

<meta http-equiv=""Content-Language"" content=""zh-cn"">

<meta http-equiv=""Content-Type"" content=""text/htmlcharset=gb2312"">

<meta name=""GENERATOR"" content=""Microsoft FrontPage 4.0"">

<meta name=""ProgId"" content=""FrontPage.Editor.Document"">

<title></title>

</head>

<body topmargin=""0"" leftmargin=""0"">

<table border=""0"" width=""760"" height=""100%"" background=""background.jpg"" >

<tr>

<td width=""752"" height=""10"" colspan=""3"">

<p align=""center"">t_title

</td>

</tr>

<tr>

<td width=""752"" height=""18"" colspan=""3"">

<div align=""center"">

</div>

<div align=""center"">

<font size=""2"">

作者:</font><font color=""#990000"">t_author</font>

<font size=""2"">

加入时间:</font><font color=""#990000"">t_date</font>

</div>

</td>

</tr>

<tr>

<td width=""15%"" height=""100%"" valign=""top"">

</td>

<td width=""70%"" height=""100%"" valign=""top"">

t_content

</td>

<td width=""15%"" height=""100%"" valign=""top"">

</td>

</tr>

</table>

</body>

</html>

3、解释

(1)pencat=rs.Fields.Item("m_content").Value

pencat为一个字符串变量。

rs.Fields.Item("m_content").Value就是如上2、网页模板的全部HTML字符

(2)pencat=replace(pencat,"t_title",n_title)

pencat=replace(pencat,"t_author",n_author)

pencat=replace(pencat,"t_content",n_content)

以上三句就是将字符串中的字串替换成为你所需要的内容,即ASP中动态获得的内容。

(3)Set fso = Server.CreateObject("Scripting.FileSystemObject")

Set fout = fso.CreateTextFile(server.mappath(fpath&"\" &fname))

fout.WriteLine pencat

fout.close

以上为将刚刚组合所得的网页代码写入文件的过程。第一句定义fso文件,第二句创建输出流文件,其中fpath为你想要存储的文件的路径,fname为文件名;后两句是将字符串写入文件和关闭输出流文件。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7446119.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-05
下一篇 2023-04-05

发表评论

登录后才能评论

评论列表(0条)

保存