闷晒式太阳能热水器:让c#运行到一句话暂停,自动打开调试器的语句是什么?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/04 22:07:08
asp中写stop,把IE,iis设置好的话,可以自动打开调试器,javascript里写debugger也可以。
但C#里,或者aspx文件里的C#脚本里不知道用什么语句,程序运行到那里可以暂停。
System.Diagnostics.Debugger.Break();
终于找到了。
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System" %>

<html>
<head>
<title> New ASP.NET Document </title>
</head>
<body bgcolor="#FFFFFF" topmargin="0" marginheight="0">

<script language="C#" runat="server">

void Page_Load(Object Source, EventArgs E) {
System.Diagnostics.Debugger.Break();
Response.Write("hello world!");
Response.Write(Session.SessionID);

}

</script>

<form runat="server" method="">

</form>

</body>
</html>

System.Diagnostics.Debugger.Launch();是自动加载调试器的。