| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 482 人关注过本帖
标题:[求助]编译方面的问题
只看楼主 加入收藏
shanous
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-7-5
收藏
 问题点数:0 回复次数:2 
[求助]编译方面的问题

版主:

请帮下忙呀!


按书本的例子:现有两个文件


Default.aspx

其源代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="test.example1" %>

<!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>
<body>
<form id="form1" runat="server">
<div>
<asp:Label ID="Label1" runat="server" Text="Label" Width="198px"></asp:Label><br />
<asp:Label ID="Label2" runat="server" Text="Label" Width="44px"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" Width="144px"></asp:TextBox><br />
<asp:Label ID="Label3" runat="server" Text="Label" Width="42px"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server" Width="146px"></asp:TextBox><br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" /></div>
</form>
</body>
</html>



Default.aspx.cs

其源代码如下:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
namespace test
{

public partial class example1 : System.Web.UI.Page
{

protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.Button Button1;
protected System.Web.UI.WebControls.Button Button2;




protected void Page_Load(object sender, EventArgs e)
{

}
protected void Button1_Click(object sender, EventArgs e)
{
if (TextBox1.Text.Trim() != "")
{
Response.Write("welcome<b>" + TextBox1.Text + "</b>use this system!<br>");
Response.Write("the password you input is:" + TextBox2.Text + "<br><br>");
}
else Response.Write("please input username and password!!!<br>");

}
protected void Button2_Click(object sender, EventArgs e)
{
TextBox1.Text = "";
TextBox2.Text = "";
}
}
}


现用csc /t:library /out ds.dll Default.aspx.cs 编译得到ds.dll文件,然后把Default.aspx 拷到iis指向的程序目录下,把ds.dll拷到该目录下的新建的文件夹bin下,浏览器上键入127.0.0.1,出现如下错误提示:

分析器错误信息: 文件“/Default.aspx.cs”不存在。
行 1: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="test.example1" %>
行 2:
行 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

请问是什么原因?不是说编译好了.dll文件,运行就不用.cs文件了吗?谢谢

搜索更多相关主题的帖子: 源代码 DTD dtd 编译 
2006-07-28 20:16
shanous
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-7-5
收藏
得分:0 

有没有人回答我的问题呀?急死人啦,,,拜托啦!!

2006-07-28 20:54
shanous
Rank: 1
等 级:新手上路
帖 子:12
专家分:0
注 册:2006-7-5
收藏
得分:0 
结帖!
2006-07-28 22:20
快速回复:[求助]编译方面的问题
数据加载中...
 
   



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

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