你好,用Dreamweaver制作动态网页时,如何使用ASP如何实现点击一个按钮然后打开文件窗口,

浏览本地硬盘上的文件。把文件中的数据显示在网页中,然后再点击一个按钮跟Oracle数据库里的一个表对碰,显示不一致的数据。有这样的例子借鉴吗?谢谢!... 浏览本地硬盘上的文件。把文件中的数据显示在网页中,然后再点击一个按钮跟Oracle数据库里的一个表对碰,显示不一致的数据。有这样的例子借鉴吗?谢谢! 展开
 我来答
无日无业
2011-11-27 · TA获得超过100个赞
知道答主
回答量:167
采纳率:100%
帮助的人:121万
展开全部
这个有点麻烦,你说的是网页上传功能吧 .还要很多代码的
,上传插件.上传进度条等等。.<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/data_ren.asp" -->
<!--#include file='fileconfig.asp'-->
<%
Dim MM_editAction
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
Dim MM_abortEdit
MM_abortEdit = false
%>
<%
If (CStr(Request("MM_insert")) = "form2") Then
If (Not MM_abortEdit) Then
' execute the insert
Dim MM_editCmd
Set MM_editCmd = Server.CreateObject ("ADODB.Command")
MM_editCmd.ActiveConnection = MM_data_ren_STRING
MM_editCmd.CommandText = "INSERT INTO T_pro (pro_name, pro_pic, pro_about) VALUES (?, ?, ?)"
MM_editCmd.Prepared = true
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param1", 202, 1, 30, Request.Form("name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param2", 202, 1, 50, Request.Form("pic_name")) ' adVarWChar
MM_editCmd.Parameters.Append MM_editCmd.CreateParameter("param3", 203, 1, 1073741823, Request.Form("about")) ' adLongVarWChar
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
' append the query string to the redirect URL
Dim MM_editRedirectUrl
MM_editRedirectUrl = "pro_add_new.asp"
If (Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
Response.Redirect(MM_editRedirectUrl)
End If
End If
%>
<!--#include file='fileconfig.asp'-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script src="SpryAssets/SpryValidationTextField.js" type="text/javascript"></script>
<SCRIPT LANGUAGE="JavaScript">
function ShowProgress()
{
strAppVersion = navigator.appVersion;
if (document.MyForm.FILE1.value != "")
{
if (strAppVersion.indexOf('MSIE') != -1 && strAppVersion.substr(strAppVersion.indexOf('MSIE')+5,1) > 4)
{
winstyle = "dialogWidth=375px; dialogHeight:175px; center:yes;status:no";
window.showModelessDialog('<% = barref %>&b=IE',window,winstyle);
}
else
{
window.open('<% = barref %>&b=NN','','width=370,height=165', true);
}
}
return true;
}
function chk()
{
if (MyForm.FILE1.value=="")
{
alert("请从硬盘选择你要上传的文件...");
return false;
}
}
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p> </p>
<p>
<%
On Error Resume Next
Server.ScriptTimeOut=999999
if request("act")="upload" then
dim folder,savepath
savepath=Server.MapPath(UploadFilePath)
CreateFolder(savepath)
Set Upload=Server.CreateObject("Persits.Upload")
Upload.SetMaxSize UploadLimitSize*1024, True
Upload.OverwriteFiles = false
if Request.QueryString("PID") = "" then
Upload.ProgressID="010D60EB00C5AA4B"
else
Upload.ProgressID=Request.QueryString("PID")
end if
Count=Upload.Save(savepath)
If Err.Number <> 0 Then
Response.Write "<div style=""color:red;font-size:12px;"">出现错误: " & Err.Number & "、" & Err.Description &"<a href=""javascript:history.go(-1)"">重新上传</a></div>"
End If
If Err.Number = 8 Then
Response.Write "<div style=""color:red;font-size:12px;"">你上传的文件超过限制("& UploadLimitSize/1024 &"M)<a href=""javascript:history.go(-1)"">重新上传</a></div>"
response.end
end if
dim inputname
dim size,rs_upfile
For Each File in Upload.Files
if not CanUpload(File.ext) then
File.Delete
response.write "<div style=""color:red;font-size:12px;"">"&file.filename &"("& file.size &") 格式不正确!<a href=""javascript:history.go(-1)"">重新上传</a></div>"
else
dim NewName
NewName = year(now) & "-" & month(now) & "-" & day(now) & "-" & hour(now) & "-" & minute(now) & "-" & second(now) & File.ext
File.Move savepath & "\" & NewName
response.Redirect("pro_add_new.asp?fn=" & file.filename )
<!-- "&file.filename &"("& file.size &") -->
end if
next
else
%>
<%
dim SPid,PID,barref
Set UploadProgress = Server.CreateObject("Persits.UploadProgress")
SPid = UploadProgress.CreateProgressID()
PID = "PID=" & SPid
barref = "framebar.asp?to=10&" & PID
%>
</p>
<table width="740" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="740" height="32"><form action="?<% = PID %>&act=upload&jsid=<%=request.QueryString("jsid")%>&id=<%=request.QueryString("id")%>" method="post" enctype="multipart/form-data" name="MyForm" id="MyForm" onsubmit="return ShowProgress();">
<p>选择图片:
<label for="FILE1"></label>
<input type="file" name="FILE1" id="FILE1" />
<input type="submit" name="button" id="button" value="上传" onclick="return chk()" />
</p>
<p><img src="pro_photo/<% if request.QueryString("fn")="" then
response.write(request.QueryString("fn"))
else
response.write("0.jpg")
end if
%> width="183" height="132" /></p>
</form>
<p>
<%end if%>
</p></td>
</tr>
<tr>
<td><form id="form2" name="form2" method="POST" action="<%=MM_editAction%>">
<p>  标题:
<label for="name"></label>
<span id="sprytextfield1">
<input type="text" name="name" id="name" />
<span class="textfieldMaxCharsMsg">已超过最大字符数。</span></span></p>
<p>
<input name="pic_name" type="hidden" id="pic_name" value="<%= Request.QueryString("fn") %>" />
</p>
<p>  备注:
<label for="about"></label>
<textarea name="about" id="about" cols="45" rows="5"></textarea>
</p>
<p>       
<label for="button2"></label>
<input type="submit" name="button2" id="button2" value="提交" />
</p>
<p> </p>
<input type="hidden" name="MM_insert" value="form2" />
</form></td>
</tr>
</table>
<script type="text/javascript">
var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "none", {validateOn:["blur"], maxChars:30, isRequired:false});
</script>
</body>
</html>
guolixin68
2011-11-23 · 超过51用户采纳过TA的回答
知道小有建树答主
回答量:207
采纳率:0%
帮助的人:125万
展开全部
用dw做这样的程序。简直要崩溃了吧,还是改用java,php或者vs做的好。具体可以QQ群:128485855
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式