?? default.aspx
字號:
public sub checkadmin(obj As object,e As eventargs)'檢查管理員身份
if name.text=ConfigurationSettings.AppSettings("管理帳號") and password.text=ConfigurationSettings.AppSettings("管理密碼") then
myconn.close()
myconn.dispose()
session("isadmin")=ConfigurationSettings.AppSettings("管理帳號")
response.redirect("default.aspx")
Else
codemessage="loginerror"
end if
end sub
public sub postreply(obj As object,e As eventargs)'處理回復事件
dim replycontent as string=replace(replytextbox.text,chr(13),"<br>")
dim replycomm As New oledbcommand("update guest set reply='"& replycontent &"',redate=getdate() where id="&request.querystring("replyid"),myconn)
replycomm.executenonquery()
myconn.close()
myconn.dispose()
response.redirect("default.aspx")
end sub
public sub modreply(obj As object,e As eventargs)'處理修改回復事件
dim modre as string=replace(modreplys.text,chr(13),"<br>")
dim modcomm As New oledbcommand("update guest set reply='"& modre &"',redate=getdate() where id="&request.querystring("replyid"),myconn)
modcomm.executenonquery()
myconn.close()
myconn.dispose()
response.redirect("default.aspx")
end sub
public sub gettext()'給修改回復文本框賦值
dim readreply As New OleDbDataAdapter("select * from guest where id="&request.querystring("replyid"),myconn)
readreply.fill(ds,"replytemp")
dim modtext as string=replace(ds.Tables("replytemp").Rows(0)(11),"<br>",chr(13))
modreplys.text=modtext
end sub
Public Sub on_submitmod(obj As object,e As eventargs)'處理修改留言設置事件
If session("isadmin")<>"" then
If len(setbgcolor.text)<>6 Or len(setlinebg.text)<>6 Or len(setline.text)<>6 Or len(setrebg.text)<>6 Or len(setlink.text)<>6 Or len(settext.text)<>6 Or len(setretext.text)<>6 Then response.redirect("default.aspx")
Dim selxml As string=server.mappath("web.config")
try
dsxml.readxml(selxml)
dsxml.Tables(1).Rows(0)(1)=setname.text
dsxml.Tables(1).Rows(1)(1)=sethomepage.text
dsxml.Tables(1).Rows(2)(1)=seturl.text
dsxml.Tables(1).Rows(3)(1)=setemail.text
dsxml.Tables(1).Rows(5)(1)=setpage.text
dsxml.Tables(1).Rows(6)(1)=setlogo.text
dsxml.Tables(1).Rows(7)(1)="#"+setbgcolor.text
dsxml.Tables(1).Rows(8)(1)="#"+setlinebg.text
dsxml.Tables(1).Rows(9)(1)="#"+setline.text
dsxml.Tables(1).Rows(10)(1)="#"+setrebg.text
dsxml.Tables(1).Rows(11)(1)="#"+setlink.text
dsxml.Tables(1).Rows(12)(1)="#"+settext.text
dsxml.Tables(1).Rows(13)(1)="#"+setretext.text
dsxml.Tables(1).Rows(14)(1)=setadmin.text
dsxml.Tables(1).Rows(15)(1)=setpassword.text
dsxml.Tables(1).Rows(16)(1)=mailserver.text
dsxml.Tables(1).Rows(17)(1)=replymail.text
dsxml.acceptchanges()
dsxml.writexml(selxml)
dsxml.clear()
response.redirect("default.aspx")
Catch objex As exception
response.redirect("default.aspx")
End Try
else
response.redirect("default.aspx")
End If
End Sub
Public Sub page_unload() '處理頁面關閉事件
MyConn.Close()
MyConn.Dispose()
ds.clear()
dsxml.clear()
ds.dispose()
dsxml.dispose()
End Sub
Public Function CheckNum(number) As Integer'檢查提交內容是數字的函數
Try
Dim i As Integer = number
Return(i)
Catch objex As Exception
Return(1)
End Try
End Function
public Function F_IP(IP)'過濾IP函數
if session("isadmin")="" then
dim ips
ips=Split(ip,".")
F_IP=ips(0)&"."&ips(1)&".*.*"
else
F_IP=IP
end if
end Function
'語法處理函數
Function autochange(postcontent)
autochange=postcontent
if not autochange<>"" then exit function
autochange=AutoURL(autochange,"http://")
autochange=AutoURL(autochange,"ftp://")
autochange=AutoURL(autochange,"rtsp://")
autochange=AutoURL(autochange,"mms://")
autochange=replace(autochange,"/"&chr(176),"/",1,-1,1)
End Function
function AutoURL(posturl,cmode)
Dim cText As string=posturl
Dim startubb=1
do
startubb=1
Dim endubb_a=0
Dim endubb_b=0
Dim endubb=0
startubb=instr(startubb,cText,cmode,1)
if startubb=0 then exit do
endubb_b=instr(startubb,cText,"<",1)
endubb_a=instr(startubb,cText," ",1)
endubb=endubb_a
if endubb=0 then
endubb=endubb_b
end if
if endubb_b<endubb and endubb_b>0 then
endubb=endubb_b
end if
if endubb=0 then
Dim lenc=ctext
endubb=len(lenc)+1
end if
if startubb>endubb then exit do
Dim text=mid(cText,startubb,endubb-startubb)
Dim codetext As string=text
Dim urllink As String ="<img src=images/icon/url.gif align=absbottom alt='自動識別的URL' border=0><a href='"& codetext &"' target=_blank>"& codetext &"</a>"
urllink=replace(urllink,"/","/"&chr(176),1,-1,1)
cText=replace(cText,text,urllink,1,1,1)
loop
AutoURL=cText
end function
</script>
<html>
<head>
<title><%=ConfigurationSettings.AppSettings("網站名稱")%>留言簿</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style>
TEXTAREA {
BORDER-RIGHT: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid; BORDER-TOP: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid; BORDER-LEFT: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid; COLOR: <%=ConfigurationSettings.AppSettings("字體顏色")%>; BORDER-BOTTOM: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid; BACKGROUND-COLOR: <%=ConfigurationSettings.AppSettings("留言框背景色")%>;font-family:"宋體";
}
.gueststyleline{ color:<%=ConfigurationSettings.AppSettings("字體顏色")%>; background-color: <%=ConfigurationSettings.AppSettings("表格邊框色")%> ;font-family: "宋體"}
.gueststylebg{color:<%=ConfigurationSettings.AppSettings("字體顏色")%>; background-color: <%=ConfigurationSettings.AppSettings("留言框背景色")%> ;font-family: "宋體"}
.gueststylerebg{ color:<%=ConfigurationSettings.AppSettings("字體顏色")%>; background-color: <%=ConfigurationSettings.AppSettings("回復框背景色")%> ;font-family: "宋體"}
.gueststylehr{color:<%=ConfigurationSettings.AppSettings("表格邊框色")%>}
INPUT.TEXT
{
BORDER-RIGHT: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid;
BORDER-TOP: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid;
BORDER-LEFT: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid;
BORDER-BOTTOM: <%=ConfigurationSettings.AppSettings("字體顏色")%> 1px solid;
BACKGROUND-COLOR: <%=ConfigurationSettings.AppSettings("留言框背景色")%>;
; font-style:normal
; color: <%=ConfigurationSettings.AppSettings("字體顏色")%>
; font-family: "宋體"
}
BODY{
FONT-FAMILY: "宋體"; FONT-SIZE: 9pt;
SCROLLBAR-3DLIGHT-COLOR:<%=ConfigurationSettings.AppSettings("表格邊框色")%>;
SCROLLBAR-SHADOW-COLOR:<%=ConfigurationSettings.AppSettings("表格邊框色")%>;
SCROLLBAR-DARKSHADOW-COLOR:<%=ConfigurationSettings.AppSettings("留言簿背景色")%>;
SCROLLBAR-FACE-COLOR:<%=ConfigurationSettings.AppSettings("留言框背景色")%>;
SCROLLBAR-ARROW-COLOR:<%=ConfigurationSettings.AppSettings("表格邊框色")%>;
SCROLLBAR-TRACK-COLOR:<%=ConfigurationSettings.AppSettings("留言簿背景色")%>
; background-color:<%=ConfigurationSettings.AppSettings("留言簿背景色")%>}
A:visited {
TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline overline
}
A:link {
color: <%=ConfigurationSettings.AppSettings("超鏈接顏色")%>; text-decoration: none; font-size: 9pt
}
A:visited {
color: <%=ConfigurationSettings.AppSettings("超鏈接顏色")%>; TEXT-DECORATION: none
}
A:active {
TEXT-DECORATION: none
}
A:hover {
TEXT-DECORATION: underline overline
}
.FILTER {
FILTER: glow(color=<%=ConfigurationSettings.AppSettings("字體顏色")%>,direction=135)
}
.replytext {
color:<%=ConfigurationSettings.AppSettings("回復字體顏色")%>;font-family: "宋體"
}
TD,DIV,form ,OPTION,P,TD,BR{FONT-FAMILY: 宋體; FONT-SIZE: 9pt}
INPUT {
BORDER-TOP-WIDTH: 1px; PADDING-RIGHT: 1px; PADDING-LEFT: 1px; BORDER-LEFT-WIDTH: 1px; FONT-SIZE: 9pt; BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-WIDTH: 1px; BORDER-BOTTOM-COLOR: #cccccc; PADDING-BOTTOM: 1px; BORDER-TOP-COLOR: #cccccc; PADDING-TOP: 1px; HEIGHT: 18px; BORDER-RIGHT-WIDTH: 1px; BORDER-RIGHT-COLOR: #cccccc
}
form {margin:0; padding:0}
</style>
<script language="JavaScript">
<!--
function checkqq(qqnumber){
if (qqnumber.length<=10&&qqnumber.length>=5){
for (var i = 0; i < qqnumber.length; i++)
{
isNumber = 0;
for (var j=0; j<10; j++) if ("" + j == qqnumber.charAt(i)) isNumber = 1;
if (isNumber == 0) {return false;}
}
return true;
}
return false;
}
function checkform(thisform)
{
if(thisform.username.value==""){
alert("昵稱不能留空!")
thisform.username.focus()
return(false)
}
if(thisform.username.value.length>8){
alert("昵稱不能超過8個字符!")
thisform.username.focus()
return(false)
}
if(thisform.caption.value==""){
alert("留言主題不能留空!")
thisform.caption.focus()
return(false)
}
if(thisform.caption.value.length>40){
alert("留言主題不能超過40字符!")
thisform.caption.focus()
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -