⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 default.aspx

📁 互动留言簿.NET2.0
💻 ASPX
📖 第 1 页 / 共 5 页
字号:
       DbListBind()
       Else
       DBListBindSearch()
       End If 
End If
End Sub

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>")
replycontent=replace(replycontent,chr(39),"''")
   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>")
modre=replace(modre,chr(39),"''")
   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
ds.readxml(selxml)
ds.Tables(1).Rows(0)(1)=setname.text
ds.Tables(1).Rows(1)(1)=sethomepage.text
ds.Tables(1).Rows(2)(1)=seturl.text
ds.Tables(1).Rows(3)(1)=setemail.text
ds.Tables(1).Rows(5)(1)=setpage.text
ds.Tables(1).Rows(6)(1)=setlogo.text
ds.Tables(1).Rows(7)(1)="#"+setbgcolor.text
ds.Tables(1).Rows(8)(1)="#"+setlinebg.text
ds.Tables(1).Rows(9)(1)="#"+setline.text
ds.Tables(1).Rows(10)(1)="#"+setrebg.text
ds.Tables(1).Rows(11)(1)="#"+setlink.text
ds.Tables(1).Rows(12)(1)="#"+settext.text
ds.Tables(1).Rows(13)(1)="#"+setretext.text
ds.Tables(1).Rows(14)(1)=setadmin.text
ds.Tables(1).Rows(15)(1)=setpassword.text
ds.Tables(1).Rows(16)(1)=mailserver.text
ds.Tables(1).Rows(17)(1)=replymail.text
ds.Tables(1).Rows(18)(1)=ipinfo.SelectedItem.Value
ds.acceptchanges()
ds.writexml(selxml)
ds.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()
ds.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")="" and ConfigurationSettings.AppSettings("ipinfo")="关闭" 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,"&nbsp;",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>12){

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -