asp操作XML
Dim xmlDoc
NewsConfigFile=server.MapPath("/test.xml")
Set xmlDoc=Server.CreateObject("msxml2.FreeThreadedDOMDocument.3.0")
If Not xmlDoc.load(NewsConfigFile) Then
'XmlDoc.loadxml "<?xml version=""1.0"" encoding=""gb2312""?><NewscodeInfo/>"
response.Write("不存在数据")
response.End()
End If
Dim colsNum,newsLine,rndInt
set newsNode = xmlDoc.DocumentElement.childNodes
for i=0 to newsNode.length-1
if newsNode(i).firstChild.text=val then
call listErr(val&"已存在")
response.End()
end if
next
'添加新节点
Set newNode = XmlDoc.createNode(1,"list","")
xmlDoc.DocumentElement.appendChild(newNode)
Set newNode2 = XmlDoc.createNode(1,"name","")
newNode2.text=val
newNode.appendChild(newNode2)
'添加新属性
set newAttr=XmlDoc.createAttribute("time") ’修改已存在属性 newNode.getAttributeNode("time").nodeValue=now()
newAttr.text=now()
newNode.attributes.setNamedItem(newAttr)
'保存
xmlDoc.save NewsConfigFile
set xmlDoc=nothing
显示XML
test.xml
<?xml version="1.0" encoding="gb2312"?>
<?xml-stylesheet type="text/xsl" href="test1.xsl"?>
<lists>
<list time="oooooo">
<name>xxxxxxxx</name>
</list>
....
</lists>
test1.xsl
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div style="background:#fff;">
<table>
<xsl:for-each select="lists/list">
<xsl:sort select="@time" order="descending" />
<tr>
<td width="120">标题:</td>
<td width="380"><xsl:value-of select="name" /></td>
<td><xsl:value-of select="@time" /></td>
</tr>
</xsl:for-each>
</table>
</div>
</xsl:template>
</xsl:stylesheet>
相关文档:
相信我的,只有我才真正地找过答案,其它都是乱抄的,实能解决到你的问题,前个月我还在苦找答案,也已试验过N次,最后成功了,网上也有改那个什么帐户的,那个实在太难了.
按我的方法,前提是一,系统是XP,其它系统不敢包.二,你没有做过其它设置.
主要是帐户权限问题.
打开“管理工具”->“组件服务”- ......
Asp代码:
<%
set obj=server.CreateObject("wsImage.Resize")
obj.LoadSoucePic server.mappath("25.jpg")
obj.LoadImgMarkPic server.mappath("blend.bmp")
obj.Quality=75
obj.AddImgMark server.mappath("imgMark.jpg"), 315, 220,&hFFFFFF, 70
strError=obj.errorinfo
if strError<>"" then
......
文件头用了
<%@Language="VBScript" CodePage="65001"%>
文件本身已经是Utf-8的编码了
提交过到Access库中怎么都是 “产品介绍 ”这样的编码
一步步分析,不存库直接输出,也是这样的编码。想来跟Access无关了。
相于迷惑,后来重新建一个表单元,提交 ......
以下为引用的内容:
<!--这是一个主页文件-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>幻灯片新闻</title>
</head>
<body>
<!--#Include file="diaoyong.asp"-->
</body>
</html>
& ......
ASP+Access数据库的18条安全法则:
1.首先,我们需要过滤所有客户端提交的内容,其中包括?id=N一类,另外还有提交的html代码中的操作数据库的select及asp文件操作语法,大家可以把提交的字符转义,然后再存入数据库。
2.然后需要对访问Access数据库的页面进行授权,针对显示数据页面只能使用select语句,过滤其他的update,asp ......