申请工作日前不工作

时间:2012-04-22 19:00:58

标签: c# asp.net c#-4.0

我的项目前天正在工作,但它的工作不再那么奇怪了。

我没有对代码进行任何更改。网页不断出现错误webdev.webserver40.exe has stopped working错误。这是我的网站代码:

    <%@ Page Title="Loading..." Language="C#" MasterPageFile="~/Site1.master" AutoEventWireup="true"
    CodeBehind="~/Loading.aspx.cs" Inherits="memberlogin.Loading" %>


<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
setTimeout('Redirect()',4000);
function Redirect()
{
  location.href = 'Members.aspx';
}
</script>
    <style type="text/css">
        .style1
        {
            width: 80%;
            background-image: url('Images/loading.gif');
            height: 100%;
        }
        .bg
        {
            width: 960px ;
            height: auto;
            background-image: url('Images/clouds.jpg');
        }
    </style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent" >
    <h1>
        <span class="input">Members-only page.</span>
    </h1>
    <h2>
        Client Side Application Download Started.
    </h2>
            &nbsp;&nbsp;
            <table class="style1">
                <tr>
                    <td align="center" valign="middle">
            <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        <br />
                        Loading, Please wait...<br />
                        <br />
                    </td>
                </tr>
            </table>
            <br />
            <br />

</asp:Content>

我放了一个try catch块来了解错误是什么。这是背后的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Net;
using System.Web.UI.WebControls;

namespace memberlogin
{
    public partial class Loading : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            System.Threading.Thread t = new System.Threading.Thread(new System.Threading.ThreadStart(Launcher));
            t.Start();
        }

        public void Launcher()
        {

            try
            {
                string filename = "~/Downloads/User.exe";
                WebClient req = new WebClient();
                HttpResponse Response = HttpContext.Current.Response;
                Response.Clear();
                Response.ClearContent();
                Response.ClearHeaders();
                Response.Buffer = true;
                Response.AddHeader("Content-Disposition", "attachment;filename=\"" + Server.MapPath(filename) + "\"");
                byte[] data = req.DownloadData(Server.MapPath(filename));
                Response.BinaryWrite(data);
                Response.End();
            }
            catch (Exception e)
            {
                System.Windows.Forms.MessageBox.Show(e.Message + e.Source);
            }

        }
    }
}

我现在收到此错误: enter image description here

MemberLogin是我项目的名称。我需要在早上[我的晚上]提交这个,我还需要做文件,请帮助我。我有大约6个小时而不是更多。

1 个答案:

答案 0 :(得分:0)

尝试确定异常抛出位置的一种好方法是启用第一次机会异常:

在Visual Studio中:

调试&gt;例外&gt; CLR例外&gt;抛出(选中)

每次抛出异常时,调试器都会中断。