📄 admin_down_add.aspx
字号:
<%@ Page Language="VB" ContentType="text/html"%>
<%@ Import Namespace="system.data" %>
<%@ Import Namespace="system.data.oledb" %>
<%@ Register TagPrefix="admin" TagName="menu" Src="../lib/adminmenu.ascx" %>
<%@ Register TagPrefix="admin" TagName="foot" Src="../lib/adminfoot.ascx" %>
<script runat="server">
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0; data source="+server.MapPath("../data/down.mdb"))
'页面载入时的动作(page load action)
sub page_load(obj as object, e as eventargs)
if not page.Ispostback then
soft_sort.datasource=filldata("select * from d_cat")
soft_sort.databind()
conn.close()
end if
end sub
sub add_soft(obj as object,e as eventargs)
dim select_soft as string
dim i as integer
for i=0 to soft_sort.items.count-1
if soft_sort.items(i).selected then
select_soft=soft_sort.items(i).tostring
exit for
end if
next
dim objcmd as new oledbcommand("insert_soft",conn)
objcmd.commandtype=commandtype.StoredProcedure
dim objParam as oledbParameter
objParam=objcmd.Parameters.add("@soft_name",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_name.value
objParam=objcmd.Parameters.add("@soft_size",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_size.value
objParam=objcmd.Parameters.add("@soft_mode",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_mode.value
objParam=objcmd.Parameters.add("@soft_roof",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_roof.value
objParam=objcmd.Parameters.add("@soft_commend",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_commend.value
objParam=objcmd.Parameters.add("@soft_home",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_home.value
objParam=objcmd.Parameters.add("@soft_demo",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_demo.value
objParam=objcmd.Parameters.add("@soft_showpic",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_showpic.value
objParam=objcmd.Parameters.add("@soft_catname",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=select_soft
objParam=objcmd.Parameters.add("@soft_catid",oledbtype.integer)
objParam.direction=parameterdirection.input
objParam.value=soft_sort.value
objParam=objcmd.Parameters.add("@soft_desc",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=replace(soft_desc.value,vbcrlf,"<br>")
objParam=objcmd.Parameters.add("@soft_url1",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_url1.value
objParam=objcmd.Parameters.add("@soft_url2",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_url2.value
objParam=objcmd.Parameters.add("@soft_url3",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_url3.value
objParam=objcmd.Parameters.add("@soft_url4",oledbtype.char)
objParam.direction=parameterdirection.input
objParam.value=soft_url4.value
try
conn.open()
objcmd.executenonquery
conn.close()
response.Write("<center>NAME:[" & soft_name.value & "]insert is ok!</center>")
catch ex as exception
response.Write(ex.message)
end try
end sub
function filldata(sql as string) as oledbdatareader
dim objcmd as new oledbcommand(sql,conn)
try
objcmd.connection.open()
return objcmd.executereader()
catch ex as exception
response.Write(ex.message)
finally
end try
end function
function executeSQl(sql as string)
dim objcmd as new oledbcommand(sql,conn)
try
conn.open()
objcmd.executenonquery
catch ex as exception
response.Write(ex.message)
exit function
finally
conn.close()
end try
end function
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>下载管理</title>
<link href="../site_css.css" rel="stylesheet" type="text/css">
</head>
<body background="../images/bg1.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center">
<td height="8" colspan="3">
</td>
</tr>
<tr>
<td width="150" align="left" valign="top"> <admin:menu runat="server"/> </td>
<td width="1" background="../images/dotlinev.gif"></td>
<td width="554" valign="top">
<form runat="server">
<a href="admin_down.aspx">[下载项目管理]</a>
<a href="admin_down_sort.aspx">[下载类别管理]</a>
<a href="admin_down_add.aspx">[增加下载项目]</a>
<p>
<table width="98%" border="0" cellspacing="1" cellpadding="4" bgcolor="#293863" align="center">
<tr>
<td colspan="2" class="diaryhead">新增软件</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">软件名称</td>
<td width="84%" class="chinese">
<input type="text" id="soft_name" size="40" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">软件大小</td>
<td width="84%" class="chinese">
<input type="text" id="soft_size" size="20" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">授权方式</td>
<td width="84%" class="chinese">
<input type="text" id="soft_mode" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">应用平台</td>
<td width="84%" class="chinese">
<input type="text" id="soft_roof" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">推荐程度</td>
<td width="84%" class="chinese">
<select id="soft_commend" runat="server">
<option value="5">5stars</option>
<option value="4">4stars</option>
<option value="3">3stars</option>
<option value="2">2stars</option>
<option value="1">1stars</option>
<option value="0">0stars</option>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">所属分类</td>
<td width="84%" class="chinese">
<select id="soft_sort" runat="server" datatextfield="cat_name" datavaluefield="cat_id">
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">演示地址</td>
<td width="84%" class="chinese">
<input type="text" id="soft_demo" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">主页地址</td>
<td width="84%" class="chinese">
<input type="text" id="soft_home" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">图片地址</td>
<td width="84%" class="chinese">
<input type="text" id="soft_showpic" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">程序简介</td>
<td width="84%" class="chinese">
<textarea id="soft_desc" cols="65" rows="10" class="textarea" runat="server"></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">下载地址1</td>
<td width="84%" class="chinese">
<input type="text" id="soft_url1" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">下载地址2</td>
<td width="84%" class="chinese">
<input type="text" id="soft_url2" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">下载地址3</td>
<td width="84%" class="chinese">
<input type="text" id="soft_url3" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="16%" class="chinese">下载地址4</td>
<td width="84%" class="chinese">
<input type="text" id="soft_url4" size="60" class="textarea" runat="server">
</td>
</tr>
<tr bgcolor="#E8E8E8">
<td colspan="2" class="chinese" align="center" height="30">
<input type="submit" name="Submit" value="确定新增" onserverclick="add_soft" runat="server" class="button">
<input type="reset" name="Reset" value="清空重填" class="button">
[<a href="admin_down.asp">返回</a>] </td>
</tr>
</table>
</form>
<br>
</td>
</tr>
<tr>
<td colspan="3" height="1" background="../images/dotlineh.gif"></td>
</tr>
</table>
<admin:foot runat="server"/>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -