62,046
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="utf-8" ?>
<website>
<title>csdn</title>
<logo>images/1250289581_2973103b.jpg</logo>
</website>
public static string GetTitle()
{
string path = HttpContext.Current.Server.MapPath("XMLFile2.xml");
XmlDocument xml = new XmlDocument();
xml.Load(path);
XmlNode node = xml.SelectSingleNode("/website/title");
return node.InnerText;
}
public static string GetLogo()
{
string path = HttpContext.Current.Server.MapPath("XMLFile2.xml");
XmlDocument xml = new XmlDocument();
xml.Load(path);
XmlNode node = xml.SelectSingleNode("/website/logo");
return node.InnerText;
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title><%=GetTitle() %></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<img src="<%=GetLogo() %>" />
</div>
</form>
</body>
</html>
[code=HTML]<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Wage_Main.aspx.cs" Inherits="Wage_Main" %>
<!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 runat="server">
<title>无标题页</title>
</head>
<frameset rows="100,*" cols="*" framespacing="0" frameborder=10 border="0" bordercolor="#FF0000">
<frame src="Wage_Main_Top.aspx" name="left" scrolling="no" >
<frame name="main" scrolling="No" src="Wage_Welcome.aspx" >
<noframes>
<body>
<p>
看不到?</p>
</body>
</noframes>
</frameset>
</html>
[/code]