资讯

精准传达 • 有效沟通

从品牌网站建设到网络营销策划,从策略到执行的一站式服务

图片上传功能demo,利用html5的剪贴板api接口

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="TestAPI.WebForm1" %>

公司主营业务:成都网站建设、成都网站制作、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。成都创新互联公司是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。成都创新互联公司推出西塞山免费做网站回馈大家。

test

test p_w_picpath paste in browser

   

   

using System;

using System.Collections.Generic;

using System.Linq;

using System.Web;

using System.Web.UI;

using System.Web.UI.WebControls;

namespace TestAPI

{

    public partial class WebForm1 : System.Web.UI.Page

    {

        protected void Page_Load(object sender, EventArgs e)

        {

            string[] array = Request.Form.AllKeys;

            if (array.Length > 0)

            {

                HttpPostedFile postFileBase;

                if (Request.Files.Count > 0)

                {

                    string dirPath = this.Server.MapPath("~/1");

                    //如果文件夹不存在则创建

                    //FileHandle.CreateDir(dirPath);

                    //result.FileCount = Request.Files.Count;

                    //result.FilePath = new string[result.FileCount];

                    string fileNamePath = string.Empty;

                    for (int i = 0; i < Request.Files.Count; i++)

                    {

                        postFileBase = Request.Files[Request.Files.AllKeys[i]];

                        if (postFileBase != null)

                        {

                            if (postFileBase.ContentType.StartsWith("p_w_picpath"))

                            {

                                postFileBase.SaveAs(string.Format("{0}\\{1}.png", dirPath, DateTime.Now.Ticks.ToString()));

                            }

                            else if (postFileBase.ContentType.StartsWith("text"))

                            {

                                postFileBase.SaveAs(string.Format("{0}\\{1}.txt", dirPath, DateTime.Now.Ticks.ToString()));

                            }

                        }

                    }

                }

            }

        }

    }

}


当前标题:图片上传功能demo,利用html5的剪贴板api接口
标题路径:http://cdkjz.cn/article/ghoogj.html
多年建站经验

多一份参考,总有益处

联系快上网,免费获得专属《策划方案》及报价

咨询相关问题或预约面谈,可以通过以下方式与我们联系

大客户专线   成都:13518219792   座机:028-86922220