復制代碼 代碼如下:
protected void Button1_Click(object sender, EventArgs e)
{
int a = 5;
int b = 2;
int c;
c = a / (b - 2);
}
復制代碼 代碼如下:
protected void Application_Error(object sender, EventArgs e)
{
//獲取異常信息
string strError = Server.GetLastError().ToString();
//可以將錯誤信息通過log4net寫入到文本或數庫中,這里只寫在頁面上
Response.Write("錯誤信息:" + strError + "");
Server.ClearError();
}
新聞熱點
疑難解答
圖片精選