温馨提示:代码在线浏览功能只能做为源码浏览参考,如果想更进一步了解该代码请下载:BugTrack免安装英文原版2.4.8
当前文件:
XTXHGRGZAXU57/ajax.aspx[1K,2009-6-12 12:00:16],打开代码结构图
XTXHGRGZAXU57/ajax.aspx[1K,2009-6-12 12:00:16],打开代码结构图1<%@ Page language="C#"%> 2
<!-- #include file = "inc.aspx" --> 3
4
<script runat="server"> 5
6
DbUtil dbutil; 7
Security security; 8
9
/////////////////////////////////////////////////////////////////////// 10
void Page_Load(Object sender, EventArgs e) 11
{ 12
13
Util.do_not_cache(Response); 14
dbutil = new DbUtil(); 15
security = new Security(); 16
security.check_security(dbutil, HttpContext.Current, Security.ANY_USER_OK); 17
18
string bugid = Util.sanitize_integer(Request["bugid"]); 19
20
// check permission 21
if (Util.get_bug_permission_level(Convert.ToInt32(bugid), security, dbutil) != Security.PERMISSION_NONE) 22
{ 23
// get the first bug comment or the email that created this bug 24
string sql = @"select top 1 substring(bp_comment,0,400) from bug_posts 25
where bp_bug = $id 26
and bp_type in ('received','comment') 27
order by bp_date"; 28
29
sql = sql.Replace("$id",bugid); 30
string s = (string) dbutil.execute_scalar(sql); 31
32
if (s == null) 33
{ 34
Response.Write (""); 35
} 36
else 37
{ 38
// indicate that there's more text 39
if (s.Length == 399) 40
{ 41
s+= "..."; 42
} 43
// preserve line breaks 44
s = HttpUtility.HtmlEncode(s); 45
s = s.Replace("\n\n","\n"); 46
s = s.Replace("\n","<br>"); 47
Response.Write (s); 48
} 49
} 50
else 51
{ 52
Response.Write (""); 53
} 54
} 55
56
57
</script> 58
59







}
