|
ASP原始碼美化效果演示 |
|
|
|
|
|
SourceFormatX 使用強大的ASP詞法解析引擎全面地分析您的原始碼並根據用戶自定義的ASP原始碼風格重構和美化ASP原始碼檔案,因此它能精細地根據不同的原始碼風格美化多種原始碼,甚至是下面這些極度混亂的原始碼:
|
這是一個 ASP 原始碼美化的範例,其目的是為了展示 SourceFormatX ASP程式碼美化工具詞法解析引擎的威力。這份混亂的ASP原始碼檔案在1秒種內即被SourceFormatX美化和縮排成整潔的版式。
<%@ language=VBScript %>
<html>
<head>
<title>Draupnir Software</title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#ffffff">
<div align="center">
<table border="1" cellpadding="0" cellspacing="0">
<tr><td width="100%"><%=gbook_name%></td></tr>
</table>
</div>
<%
call htmlend()
Response.End:end sub
sub addto()
dim username, email, homeurl, qq, body, addtime, sql, Rs, ip, face, brow
username=htmlencode2(trim(Request.form("username")))
email=htmlencode2(trim(Request.form("email")))
if username = "" then
message="Your nickname cannot be null!\n"
elseif username = "root" then
message="Your nickname cannot be root!\n"
end if
sql="select * from retain where userid='"&userid&"'"
set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open sql,conn,1,1
do while not nrs.eof
if username <>"" and username = nrs("retain_name") then
message=message&"Your nickname was forbidden by administrator!\n"
end if
nrs.movenext
loop
nrs.close
set nrs = nothing
if email <> "" and IsValidEmail(email)=false then
message=message&"Your email maybe wrong?\n"
end if
if body <> "" and Len(body)> bodymax then
message=message&"Sorry, message length cannot over "&bodymax&" words!\n"
end if
if brow = "" then
brow="image/em01.gif"
end if
if message<> "" then
call error(""&message&"")
else
sql = "select * from gbook"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql,conn,3,2
Rs.addnew
Rs("username")=username
Rs("email")=email
Rs("homeurl")=homeurl
Rs("qq")=qq
Rs("body")=body
Rs("face")=face
Rs("brow")=brow
Rs("ip")=ip
Rs("addtime")=now
Rs("userid")=userid
Rs.update
Rs.close
sql="select * from admin where id="&userid
Rs.open sql,conn,3,2
if date <> today_time then
Rs("today_count") = 1
else
Rs("today_count") = Rs("today_count")+1
end if
Rs("today_time") = date
Rs.update
Rs.close
set Rs = nothing
conn.close
set conn = nothing
Response.redirect "index.asp?userid="&userid
Response.End
end if
end sub
%>
</body>
</html>
<%@ language=VBScript %>
<html>
<head>
<title>Draupnir Software</title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#ffffff">
<div align="center">
<table border="1" cellpadding="0" cellspacing="0">
<tr><td width="100%"><%=gbook_name%></td></tr>
</table>
</div>
<%
Call htmlend()
Response.End
End Sub
Sub addto()
Dim username, email, homeurl, qq, body, addtime, sql, Rs, ip, face, brow
username = htmlencode2(Trim(Request.form("username")))
email = htmlencode2(Trim(Request.form("email")))
If username = "" Then
message = "Your nickname cannot be null!\n"
ElseIf username = "root" Then
message = "Your nickname cannot be root!\n"
End If
sql = "select * from retain where userid='"&userid&"'"
Set nrs = Server.CreateObject("ADODB.Recordset")
nrs.open sql, conn, 1, 1
Do While Not nrs.EOF
If username <>"" And username = nrs("retain_name") Then
message = message&"Your nickname was forbidden by administrator!\n"
End If
nrs.movenext
Loop
nrs.Close
Set nrs = Nothing
If email <> "" And IsValidEmail(email) = False Then
message = message&"Your email maybe wrong?\n"
End If
If body <> "" And Len(body)> bodymax Then
message = message&"Sorry, message length cannot over "&bodymax&" words!\n"
End If
If brow = "" Then
brow = "image/em01.gif"
End If
If message<> "" Then
Call Error(""&message&"")
Else
sql = "select * from gbook"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open sql, conn, 3, 2
Rs.addnew
Rs("username") = username
Rs("email") = email
Rs("homeurl") = homeurl
Rs("qq") = qq
Rs("body") = body
Rs("face") = face
Rs("brow") = brow
Rs("ip") = ip
Rs("addtime") = Now
Rs("userid") = userid
Rs.update
Rs.Close
sql = "select * from admin where id="&userid
Rs.open sql, conn, 3, 2
If Date <> today_time Then
Rs("today_count") = 1
Else
Rs("today_count") = Rs("today_count") + 1
End If
Rs("today_time") = Date
Rs.update
Rs.Close
Set Rs = Nothing
conn.Close
Set conn = Nothing
Response.redirect "index.asp?userid="&userid
Response.End
End If
End Sub
%>
</body>
</html>
不要再浪費寶貴的時間手動整理美化ASP語言原始碼了! 現在就下載SourceFormatX原始碼美化工具!
|