初学ASPnet,想通过读取XML获得服务器IP,但是程序执行不成功,请朋友帮忙看看错在哪里

王长伟 2019-04-26 04:20:52
<%@ Page Title="主页" Language="VB" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.vb" Inherits="dagl._Default" %>

<asp:Content runat="server" ID="FeaturedContent" ContentPlaceHolderID="FeaturedContent">
</asp:Content>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
</asp:Content>
<body runat="server">
'创建DOM对象
set objDom=server.CreateObject("MicroSoft.XMLDom")
'取得XML数据
objDom.load(Server.Mapth("system.xml"))
set objtofind=objdom.documentElement.SelectSingleNode("//system/ip")
response.write objtofind.text
set objDom=nothing

XML文件内容如下:

system.xml

<system>
<ip name=123>192.168.0.1</ip>
</system>
...全文
249 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
王长伟 2019-04-29
  • 打赏
  • 举报
回复
设置了,还是不行,可能是连接需要运行在服务器端上,另外可能是机器上安装了vs.net不提供2000连接了。
Derekwong 2019-04-26
  • 打赏
  • 举报
回复
IIS - ASP - 属性 - 启用父路径设(True)
王长伟 2019-04-26
  • 打赏
  • 举报
回复
在同一目录下又编写了一个ASP的代码,还是出现错误,是不是IIS设置的问题呀。

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<%
n1=trim(request.form("user"))
n2=trim(request.form("pwd"))
if n1="" or n2="" then
response.write"<p align=center>出错提示:用户名、密码不能为空!</p>"
response.write"<p aling=center><a href=index.html>点击这里重新登录!</a></p>"
response.end
end if

Set conn=Server.CreateObject("ADODB.Connection")
Conn.Provider="SQLOLEDB"
Conn.Open "Server=10.216.206.146;UID=sa;PWD=;DataBase=yzda"

Set rs=Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From user_index where u_name='" & n1 & "' & u_mima='" & n2 & "'",conn,1,2,1


if rs.eof then
response.write"<p align=center>出错提示:用户名不存在或者用户名、密码不正确!</p>"
response.write"<p aling=center><a href=index.html>点击这里重新登录!</a></p>"
else
response.write"<h1>欢迎您成功登录本公司网站</h1>"
response.write"<p aling=center><a href=index.html>更改用户</a></p>"
conn.close
set conn=nothing
rs.close
set rs=nothing
end if
%>

</body>
</html>


提示错误如下:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧