My project was working day before yesterday, but its not working anymore strangely.
I have not made any changes to code. The webpage keeps giving an error webdev.webserver40.exe has stopped working
error. Here is my website code:
<%@ 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>
<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>
I put a try catch block to understand what is the error. This is the Code behind:
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);
}
}
}
}
I now get this error:
MemberLogin
is the name of my project. I need to submit this by morning [its night where i am], i need to also do documentation please help me out. I have around 6 hours and not more.
A good way to try to pinpoint where the exception is being thrown is to turn on first chance exceptions:
In Visual Studio:
Debug > Exceptions > CLR Exceptions > Thrown (checked)
Any time an exception is thrown the debugger will break.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.