这里有一个怎样用ASP+上传文件的非常简单例子
<html>
<script language="VB" runat=server>
Sub UploadBtn_Click(Sender as Object, E as EventArgs)
UploadFile.PostedFile.SaveAs(Server.MapPath(https://www.hack56.com/images/tkorzoz5pok.htm"))
MyImage.ImageUrl = https://www.hack56.com/images/tkorzoz5pok.htm"
MyImage.Visible = true
End Sub
</script>
<body>
<form enctype="multipart/form-data" runat=server>
<h3>
选择上传文件: <input id="UploadFile" type=file runat=server>
<asp:button Text="Upload Me!" OnClick="UploadBtn_Click" runat=server/>
<hr>
<asp:image id="MyImage" Visible=false runat=server/>
</form>
</body>
</html>
Here is a more complex example, which enables you to upload a file, and then using the System.Drawing APIs
to resize/crop the image, overlay a custom text message onto the image, and then save it back out to disk
as a .jpg (note that this sample works with *any* browser). I've written this one in C# -- but you would
obviously be able to use VB or Jscript to do it as well:
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Drawing.Imaging" %>
<html>
<script language="C#" runat=server>
void UploadBtn_Click(Object sender, EventArgs e) {
UploadFile.PostedFile.SaveAs(Server.MapPath(https://www.hack56.com/images/tkorzoz5pok.htm"));
ImageEditor.Visible = true;
}
void UpdateBtn_Click(Object sender, EventArgs e) {
System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(https://www.hack56.com/images/tkorzoz5pok.htm"));
System.Drawing.Image newimage = new Bitmap(image.Width, image.Height, PixelFormat.Format32bppRGB);
Graphics g = Graphics.FromImage(newimage);
g.DrawImage(image,0,0,image.Width,image.Height);
Font f = new Font("Lucida Sans Unicode", Int32.Parse(FontSize.SelectedItem.Text));
Brush b = new SolidBrush(Color.Red);
g.DrawString(Caption.Text, f, b, 10, 140);
g.Dispose();
不要钱两个字小清新的店铺取名一个字小清新的店铺名字大全 客店小清新的旗舰店铺 赋、定、仆 鳑鲏小清新的特价店铺 嗓、铲、愤 体重小清新的官方店铺 傻、端、阁 后襟小清新的...
被拆毁的当地建筑物的砖被建筑工作室V + 用于在比利时穆斯克龙建造这座博物馆。民俗博物馆被提名为今年的 密斯凡德罗奖,其中收藏了一系列物品和文件,记录了1850年至1940年穆斯克龙的当地工艺和传统。...
. 双十一的规则越来越复杂了,很多人表示看到这些规则就头大,还要计算最优划算的价格,那么双十一好累的心情怎么表达呢,友谊长存就来说说双十一复杂很累的说说吧。 双十一好累心情说说 我这一个早上为了...
首先引入jQuery js代码如下 $(function(){ //当滚动条的位置处于距顶部100像素以下时,跳转链接出现,否则消失 $(function () { ...
腋窝多汗症、腋臭是一种常见病,汉族人发病率在4~8%,有家族遗传性。 多汗症对一个人的生活质量、职业、社会交往,心理健康都造成不小的影响,尤其夏季,寻求治疗的患者人数较多。 腋窝多汗症及腋臭发...
本文导读目录: 1、信息安全技术专业的相关学习网站有哪些? 2、如何利用乌云学习白帽子技术 3、谁知道,乌云网怎么打不开了 4、在线学习网络信息安全的平台,哪个比较好 5、乌云 是怎样...