📄 asp+上传文件语法.htm
字号:
href="http://lzjx.com/w/main.asp?id=540&sx=jc">介绍
ADO+</A><BR>·<A title=介绍ActiveServerPage+
href="http://lzjx.com/w/main.asp?id=541&sx=jc">介绍 Active
Serv..</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=542&sx=jc">ASP+的几个特点</A><BR>·<A
title=ASP+支持的C#和VB语法对照表
href="http://lzjx.com/w/main.asp?id=543&sx=jc">ASP+ 支持的 C# 和
..</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=544&sx=jc">ASP+
跟踪</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=545&sx=jc">ASP+上传文件语法</A><BR>·<A
title=asp+简介、安装、以及如何显示中文
href="http://lzjx.com/w/main.asp?id=546&sx=jc">asp+简介、安装、以及如何..</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=547&sx=jc">Asp+ Web
Forms</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=548&sx=jc">ASP+中文显示之两种解决方法</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=441&sx=jc">ASP上手“快捷方式”-序言</A><BR>·<A
title=ASP上手“快捷方式”-剖析ASP脚本
href="http://lzjx.com/w/main.asp?id=442&sx=jc">ASP上手“快捷方式”-剖析..</A><BR>·<A
title=ASP上手“快捷方式”-对象和组件
href="http://lzjx.com/w/main.asp?id=443&sx=jc">ASP上手“快捷方式”-对象..</A><BR>·<A
title=ASP上手“快捷方式”-脚本示例
href="http://lzjx.com/w/main.asp?id=444&sx=jc">ASP上手“快捷方式”-脚本..</A><BR>·<A
title=ASP上手“快捷方式”-脚本编写技巧
href="http://lzjx.com/w/main.asp?id=445&sx=jc">ASP上手“快捷方式”-脚本..</A><BR>·<A
title=ASP上手“快捷方式”-样例脚本
href="http://lzjx.com/w/main.asp?id=446&sx=jc">ASP上手“快捷方式”-样例..</A><BR>·<A
title=ASP上手“快捷方式”-数据库
href="http://lzjx.com/w/main.asp?id=447&sx=jc">ASP上手“快捷方式”-数据..</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=523&sx=jc">ASP的技术特点与使用方法</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=522&sx=jc">SQL
Server访问ADO</A><BR>·<A
href="http://lzjx.com/w/main.asp?id=521&sx=jc">ASP个人上手指南</A><BR></TD></TR></TBODY></TABLE><SPAN
class=l15></SPAN></TD>
<TD vAlign=top align=middle width=1 bgColor=#cccccc></TD>
<TD vAlign=top align=middle width=592 bgColor=#ffffff>
<TABLE cellSpacing=0 cellPadding=6 width="98%" border=0>
<TBODY>
<TR>
<TD class=xx vAlign=bottom height=30>■ 基础教程 >
ASP+上传文件语法</TD></TR></TBODY></TABLE>
<TABLE height=119 cellSpacing=6 cellPadding=3 width="99%" border=0>
<TBODY>
<TR>
<TD class=xk vAlign=top align=left
width="50%"><BR>这里有一个怎样用ASP+上传文件的非常简单例子<BR><html>
<BR><script language="VB" runat=server><BR>Sub
UploadBtn_Click(Sender as Object, E as
EventArgs)<BR><BR> UploadFile.PostedFile.SaveAs(Server.MapPath("test.jpg"))<BR>
MyImage.ImageUrl = "test.jpg"<BR> MyImage.Visible =
true<BR><BR> End
Sub<BR><BR> </script><BR><BR> <body><BR><BR> <form
enctype="multipart/form-data"
runat=server><BR><BR> <h3><BR><BR> 选择上传文件:
<input id="UploadFile" type=file
runat=server><BR><BR> <asp:button Text="Upload Me!"
OnClick="UploadBtn_Click"
runat=server/><BR><BR> <hr><BR><BR> <asp:image
id="MyImage" Visible=false runat=server/><BR><BR>
</form><BR><BR>
</body><BR></html><BR><BR><BR>Here is a more complex
example, which enables you to upload a file, and then using the
System.Drawing APIs <BR>to resize/crop the image, overlay a custom
text message onto the image, and then save it back out to disk
<BR>as a .jpg (note that this sample works with *any* browser). I've
written this one in C# -- but you would <BR>obviously be able to use
VB or JScript to do it as well:<BR><BR><%@ Import
Namespace="System.IO" %><BR><%@ Import
Namespace="System.Drawing" %><BR><%@ Import
Namespace="System.Drawing.Imaging"
%><BR><BR><html><BR><BR><script language="C#"
runat=server><BR><BR> void UploadBtn_Click(Object sender,
EventArgs e) {<BR><BR>
UploadFile.PostedFile.SaveAs(Server.MapPath("test.jpg"));<BR>
ImageEditor.Visible = true;<BR> } <BR><BR> void
UpdateBtn_Click(Object sender, EventArgs e) {<BR><BR>
System.Drawing.Image image =
System.Drawing.Image.FromFile(Server.MapPath("test.jpg"));<BR>
System.Drawing.Image newimage = new Bitmap(image.Width,
image.Height, PixelFormat.Format32bppRGB);<BR><BR> Graphics g =
Graphics.FromImage(newimage);<BR>
g.DrawImage(image,0,0,image.Width,image.Height);<BR> Font f =
new Font("Lucida Sans Unicode",
Int32.Parse(FontSize.SelectedItem.Text));<BR> Brush b = new
SolidBrush(Color.Red);<BR> g.DrawString(Caption.Text, f, b, 10,
140);<BR> g.Dispose();<BR><BR> System.Drawing.Image
thumbImage =
newimage.GetThumbnailImage(Int32.Parse(Width.Text),Int32.Parse<BR>(Height.Text),null,0);<BR>
image.Dispose();<BR><BR>
thumbImage.Save(Server.MapPath("test.jpg"),
ImageFormat.JPEG);<BR> }<BR><BR> </script><BR><BR>
<body><BR><BR> <form enctype="multipart/form-data"
runat=server><BR><BR> <h3><BR><BR> Select File To
Upload: <input id="UploadFile" type=file
runat=server><BR><BR> <asp:button Text="Upload Me!"
OnClick="UploadBtn_Click"
runat=server/><BR><BR> <hr><BR><BR> <asp:panel
id="ImageEditor" Visible=false runat=server><BR><BR>
<img src="test.jpg"><BR><BR><h3><BR>Image Width:
<asp:textbox id="Width" runat=server/><BR><BR>Image Height:
<asp:textbox id="Height"runat=server/> <br>Text Caption:
<asp:textbox id="Caption" runat=server/>Caption Size:
<asp:dropdownlist id="FontSize"
runat=server><BR>
<asp:listitem>14</asp:listitem><BR>
<asp:listitem>18</asp:listitem><BR>
<asp:listitem>26</asp:listitem><BR>
<asp:listitem>36</asp:listitem><BR>
<asp:listitem>48</asp:listitem><BR>
<asp:listitem>62</asp:listitem><BR> </asp:dropdownlist><BR><BR><asp:button
Text="Update Image" OnClick="UpdateBtn_Click"
runat=server/><BR><BR></h3>
<BR></asp:panel><BR><BR></form><BR></body><BR></html>
</TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width="98%" border=0>
<TBODY>
<TR>
<TD>■今日推荐:<A
href="http://lzjx.com/w/main.asp?id=388&sx=jc">ASP内建对象Serv</A>
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=0 width=800 bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD background=ASP+上传文件语法.files/qw39.gif></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=1 cellPadding=5 width=800 bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD class=N noWrap align=middle>
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff
border=0><TBODY>
<TR>
<TD
background=ASP+上传文件语法.files/qw39.gif></TD></TR></TBODY></TABLE><BR>本网站是学习网站,内容整理大多来自互联网,尽量标明了出处,如果侵犯了您的权力请通知我,立即纠正<BR>欢迎提出宝贵建议,提供相关资料,以便相互学习,共同提高!<BR>
<OBJECT
codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0
height=18 width=103 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000><PARAM NAME="BGCOLOR" VALUE=""><PARAM NAME="movie" VALUE="../images/21sg.swf"><PARAM NAME="quality" VALUE="high">
<embed src="../images/21sg.swf"
quality="high"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="103" height="18" ></embed>
</OBJECT></TD></TR>
<TR>
<TD height=79> </TD></TR>
<TR>
<TD align=middle></TD></TR></TBODY></TABLE></CENTER></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -