马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
使用cdonts,可以发送、查看邮件,实现webmail的功能。结合wsh,可以实现对nt主机的管理,如nt用户管理、iis虚拟主机设置、exchange邮箱设置等等,就像管理本地机一样方便。----filename/handld_upload.asp
<%OptionExplicit%>
<%
Response.Expires=0
Response.Buffer=TRUE
Response.Clear
ConstIMAGE_SIZE="width=""200""height=""150"""
DimUploadRequest
SetUploadRequest=Server.CreateObject("Scripting.Dictionary")
DimbyteCount,RequestBin
byteCount=Request.TotalBytes
RequestBin=Request.BinaryRead(byteCount)
BuildUploadRequestRequestBin
DimsaveURL,goURL,filepathname,value,filename
----savepath
saveURL=UploadRequest.Item("saveURL").Item("Value")
saveURL="/"
----jumptofilepathwhenfinishupload
goURL=UploadRequest.Item("goURL").Item("Value")
filepathname=UploadRequest.Item("my_file").Item("FilePathName")
value=UploadRequest.Item("my_file").Item("Value")
filename=Right(filepathname,Len(filepathname)-InstrRev(filepathname,""))
----debug
Response.WritesaveURL&"**"&goURL&"**"&filepathname
Response.Write"**"&filename
Response.End
Dimfso,MyFile,i
Setfso=Server.CreateObject("Scripting.FileSystemObject")
IfNOTfso.FolderExists(Server.mappath(saveURL)&"")Then
RecMkDir(Server.mappath(saveURL)&"")
EndIf
SetMyFile=fso.CreateTextFile(Server.mappath(saveURL)&""&filename)
Fori=1toLenB(value)
MyFile.Writechr(AscB(MidB(value,i,1)))
Next
MyFile.Close
Session("StoredFile")=filename
Session("strImage")="</script>
<scriptlanguage="JavaScript">
<!--
functionUpLoad(obj)
{
if(obj.my_file.value.length<7)
returnfalse;
returntrue;
}
//-->
</script>
<bodylink=<%=COLOR_NL_1%>alink=<%=COLOR_AL_1%>vlink=<%=COLOR_VL_1%>bgcolor=<%=COLOR_BG_1%>>
<fontcolor="<%=C_WD_CONTENT_4%>">
Onlyupload<b>*.jpg</b>or<b>*.gif</b>file!
<br>
Otherwise,imagemaynotshowcorrectly!
</font>
<center>
<table>
<%If(Len(Session("strImage"))>0)Then%>
<tr>
<td>
<tableborder="1"bordercolor="<%=C_WD_T_BORDER%>"cellspacing="0"cellpadding="0"<%=IMAGE_SIZE%>>
<tr>
<td><%=Session("strImage")%></td>
</tr>
</table>
</td>
</tr>
<%Else%>
<tr>
<td>
<tableborder="1"bordercolor="<%=C_WD_T_BORDER%>"cellspacing="0"cellpadding="0">
<tr>
<tdalign="center"valign="top">
<tablecellspacing="0"cellpadding="0"border="0"<%=IMAGE_SIZE%>>
<tr>
<tdcolspan="2"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>"><b>Upload/previewimage:</b></font></td>
</tr>
<tr>
<tdcolspan="2"></td>
</tr>
<tr>
<tdvalign="top"nowrap><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>"><b>Step1:</b></font></td>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>">Prepareanimagewith72dpiresolution.</font></td>
</tr>
<tr>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>"><b>Step2:</b></font></td>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>">Selectyourimagefile</font></td>
</tr>
<tr>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>"><b>Step3:</b></font></td>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>">Press"Upload"button</font></td>
</tr>
<tr>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>"><b>Step4:</b></font></td>
<tdvalign="top"><fontclass="e-foot"color="<%=C_WD_CONTENT_4%>">Continue<b>OR</b>repeat<b>Step1-3</b>tochangetheimage</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<%EndIf%>
</table>
</center>
<formmethod="POST"enctype="multipart/form-data"action="handle_upload.asp"id=form1name=form1>
<inputtype="hidden"name="saveURL"value="<%=WEB_TEMP_PATH%>">
<inputtype="hidden"name="goURL"value="<%=Request.ServerVariables("PATH_INFO")%>">
<inputclass="btn"type="file"name="my_file">
<inputclass="btn"type="submit"name="submit"value="Upload">
</form>
<formaction="<%=thisFile%>"id=form2name=form2>
<inputclass="btn"type="submit"name="imageCancel"value="PressHereToCancelImage!">
<br><br>
<inputclass="btn"type="submit"value="Finish!"id=submit1name=submit1>
</form>
</body>
</html>
对于中小型web应用来说,php有很强的竞争力,linux+apache+mysql+php(lamp)的组合几乎可以胜任绝大多数网站的解决方案,对于大型应用来讲,对于系统架构要求更高,需要有成熟的框架支持,jsp的struts是个不错的框架,国内介绍它的资料也非常多,应用逐渐广泛起来。asp就不用说了, |