c#文件上传(b/s以及pda文件上传)

一部分b/s模式

1.新建Upfile.aspx

其代码为:

using System;
using System.IO;
using System.Web;

/// <summary> 
/// Cls_Upfile 的摘要说明 
/// </summary> 
/// 
/// 

namespace Upload
{
    public class upload
    {
        #region 变量

        protected string fileName; //原文件名(不含扩展名)
        private string fileType;
        protected string localFileExtension; //原扩展名 
        protected long localFileLength; //原文件大小 
        protected string localFileName; //原文件名(含扩展名) 
        protected string localFilePath; //原文件路径 
        private string path;
        private HttpPostedFile postedFile;
        protected string saveFileExtension; //保存的扩展名 
        //protected long saveFileLength;//保存的文件大小 
        protected string saveFileFolderPath; //保存文件的服务器端的文件夹路径 
        protected string saveFileName; //保存的文件名(含扩展名) 
        protected string saveFilePath; //保存文件的服务器端的完整路径 
        private int sizes;

        #endregion

        #region upload():初始化变量

        /**/

        /// <summary>
        ///     初始化变量
        /// </summary>
        public upload()
        {
            path = @"uploadimages"; //上传路径 
            fileType = "txt|pwd|doc";
            sizes = 1024; //传文件的大小,默认1MB 
        }

        #endregion

        #region 设置传入的值:Path/Sizes/FileType

        /**/

        /// <summary>
        ///     设置上传路径,如:uploadimages
        /// </summary>
        public string Path
        {
            set { path = @"" + value + @""; }
        }

        /**/

        /// <summary>
        ///     设置上传文件大小,单位为KB
        /// </summary>
        public int Sizes
        {
            set { sizes = value; }
        }

        /**/

        /// <summary>
        ///     设置上传文件的类型,如:txt|pwd|doc
        /// </summary>
        public string FileType
        {
            set { fileType = value; }
        }

        #endregion

        #region SaveAs()上传文件

        public string SaveAs(HttpFileCollection files)
        {
            string myReturn = "";
            try
            {
                for (int iFile = 0; iFile < files.Count; iFile++)
                {
                    postedFile = files[iFile];
                    //获得文件的上传的路径 
                    localFilePath = postedFile.FileName;
                    //判断上传文件路径是否为空 
                    if (localFilePath == null || localFilePath == "")
                    {
                        //message("您没有上传数据呀,是不是搞错了呀!"); 
                        //break; 
                        continue;
                    }
                    else
                    {
                        #region 判断文件大小

                        //获得上传文件的大小 
                        localFileLength = postedFile.ContentLength;
                        //判断上传文件大小 
                        if (localFileLength >= sizes*1024)
                        {
                            message("上传的图片不能大于" + sizes + "KB");
                            break;
                        }

                        #endregion

                        #region 文件夹

                        //获取保存文件夹路径 
                        saveFileFolderPath = getSaveFileFolderPath(path);

                        #endregion

                        #region 文件名

                        //获得原文件名(含扩展名) 
                        localFileName = System.IO.Path.GetFileName(postedFile.FileName);
                        //获取原文件名不要扩展名
                        fileName = System.IO.Path.GetFileNameWithoutExtension(postedFile.FileName);

                        saveFileName = fileName + "_" +
                                       DateTime.UtcNow.ToString("yyyy" + "MM" + "dd" + "HH" + "mm" + "ss" + "ffffff");
                        //"yyyy"+"MM"+"dd"+"HH"+"mm"+"ss"+"ffffff" 

                        #endregion

                        #region 扩展名

                        //获取原文件扩展名 
                        localFileExtension = getFileExtension(localFileName);
                        //如果为真允许上传,为假则不允许上传 
                        if (localFileExtension == "")
                        {
                            message("目前本系统支持的格式为:" + fileType);
                            break;
                        }
                        //得到保存文件的扩展名,可根据需要更改扩展名 
                        saveFileExtension = localFileExtension;

                        #endregion

                        //得到保存文件的完整路径 
                        saveFilePath = saveFileFolderPath + saveFileName + saveFileExtension;

                        postedFile.SaveAs(saveFilePath);
                        message("文件上传成功");

                        myReturn = myReturn + ((myReturn == "" || myReturn == null) ? "" : "|") +
                                   path.TrimStart(new[] {' '}) + saveFileName + saveFileExtension;

                        //以下对文章的内容进行一些加工 
                        HttpContext.Current.Response.Write(
                            "<script>parent.Article_Content___Frame.FCK.EditorDocument.body.innerHTML+='<img src=" +
                            saveFileName + saveFileExtension + " " + " border=0 />'</SCRIPT>");
                    }
                }
            }
            catch
            {
                //异常 
                message("出现未知错误!");
                myReturn = null;
            }
            return myReturn;
        }

        #endregion

        #region getSaveFileFolderPath( ):获得保存的文件夹的物理路径

        /**/


        /// <summary>
        ///     获得保存的文件夹的物理路径
        ///     返回保存的文件夹的物理路径,若为null则表示出错
        /// </summary>
        /// <param name="format">保存的文件夹路径 或者 格式化方式创建保存文件的文件夹,如按日期"yyyy"+"MM"+"dd":20060511</param>
        /// <returns>保存的文件夹的物理路径,若为null则表示出错</returns>
        private string getSaveFileFolderPath(string format)
        {
            string mySaveFolder = null;
            try
            {
                string folderPath = null;
                //以当前时间创建文件夹, 
                //!!!!!!!!!!!!以后用正则表达式替换下面的验证语句!!!!!!!!!!!!!!!!!!! 
                if (format.IndexOf("yyyy") > -1 || format.IndexOf("MM") > -1 || format.IndexOf("dd") > -1 ||
                    format.IndexOf("hh") > -1 || format.IndexOf("mm") > -1 || format.IndexOf("ss") > -1 ||
                    format.IndexOf("ff") > -1)
                {
                    //以通用标准时间创建文件夹的名字 
                    folderPath = DateTime.UtcNow.ToString(format);
                    mySaveFolder = HttpContext.Current.Server.MapPath(".") + @"" + folderPath + @"";
                }
                else
                {
                    mySaveFolder = HttpContext.Current.Server.MapPath(".") + format;
                }
                var dir = new DirectoryInfo(mySaveFolder);
                //判断文件夹否存在,不存在则创建 
                if (!dir.Exists)
                {
                    dir.Create();
                }
            }
            catch
            {
                message("获取保存路径出错");
            }
            return mySaveFolder;
        }

        #endregion

        #region getFileExtension( ):获取原文件的扩展名

        /**/

        /// <summary>
        ///     获取原文件的扩展名,返回原文件的扩展名(localFileExtension),该函数用到外部变量fileType,即允许的文件扩展名.
        /// </summary>
        /// <param name="myFileName">原文件名</param>
        /// <returns>原文件的扩展名(localFileExtension);若返回为null,表明文件无后缀名;若返回为"",则表明扩展名为非法.</returns>
        private string getFileExtension(string myFileName)
        {
            string myFileExtension = null;
            //获得文件扩展名 
            myFileExtension = System.IO.Path.GetExtension(myFileName); //若为null,表明文件无后缀名; 
            //分解允许上传文件的格式 
            if (myFileExtension != "")
            {
                myFileExtension = myFileExtension.ToLower(); //转化为小写 
            }
            string[] temp = fileType.Split('|');
            //设置上传的文件是否是允许的格式 
            bool flag = false;
            //判断上传的文件是否是允许的格式 
            foreach (string data in temp)
            {
                if (("." + data) == myFileExtension)
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                myFileExtension = ""; //不能设置成null,因为null表明文件无后缀名; 
            }
            return myFileExtension;
        }

        #endregion

        #region message( ):弹出消息框

        /**/

        /// <summary>
        ///     弹出消息框,显示内容(msg),点击"确定"后页面跳转到该路径(url)
        /// </summary>
        /// <param name="msg">显示内容</param>
        /// <param name="url">跳转路径</param>
        private void message(string msg, string url)
        {
            HttpContext.Current.Response.Write("<script language=javascript>alert('" + msg + "');window.location='" +
                                               url + "'</script>");
        }

        /**/

        /// <summary>
        ///     弹出消息框,显示内容(msg),无跳转
        /// </summary>
        /// <param name="msg">显示内容</param>
        private void message(string msg)
        {
            HttpContext.Current.Response.Write("<script language=javascript>alert('" + msg + "');</script>");
        }

        #endregion
    }
}


在Upfile.aspx.cs中的代码:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Collections;

using System.Web.Security;

using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Upload
{
    public partial class Upfile : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Upload.upload UpFiles = new Upload.upload();
            //HttpPostedFile File = FileUpload1.PostedFile; 
            // AllSheng.UploadObj.PhotoSave("/", FileUpload1); 
            HttpFileCollection files = HttpContext.Current.Request.Files;
            UpFiles.Path = "./files/";
            String ReStr = UpFiles.SaveAs(files).ToString();
            Label1.Text = ReStr;
            UpFiles = null;

        }
    }
}

然后新建upload.cs,其代码为:

using System;
using System.IO;
using System.Web;

/// <summary> 
/// Cls_Upfile 的摘要说明 
/// </summary> 
/// 
/// 

namespace Upload
{
    public class upload
    {
        #region 变量

        protected string fileName; //原文件名(不含扩展名)
        private string fileType;
        protected string localFileExtension; //原扩展名 
        protected long localFileLength; //原文件大小 
        protected string localFileName; //原文件名(含扩展名) 
        protected string localFilePath; //原文件路径 
        private string path;
        private HttpPostedFile postedFile;
        protected string saveFileExtension; //保存的扩展名 
        //protected long saveFileLength;//保存的文件大小 
        protected string saveFileFolderPath; //保存文件的服务器端的文件夹路径 
        protected string saveFileName; //保存的文件名(含扩展名) 
        protected string saveFilePath; //保存文件的服务器端的完整路径 
        private int sizes;

        #endregion

        #region upload():初始化变量

        /**/

        /// <summary>
        ///     初始化变量
        /// </summary>
        public upload()
        {
            path = @"uploadimages"; //上传路径 
            fileType = "txt|pwd|doc";
            sizes = 1024; //传文件的大小,默认1MB 
        }

        #endregion

        #region 设置传入的值:Path/Sizes/FileType

        /**/

        /// <summary>
        ///     设置上传路径,如:uploadimages
        /// </summary>
        public string Path
        {
            set { path = @"" + value + @""; }
        }

        /**/

        /// <summary>
        ///     设置上传文件大小,单位为KB
        /// </summary>
        public int Sizes
        {
            set { sizes = value; }
        }

        /**/

        /// <summary>
        ///     设置上传文件的类型,如:txt|pwd|doc
        /// </summary>
        public string FileType
        {
            set { fileType = value; }
        }

        #endregion

        #region SaveAs()上传文件

        public string SaveAs(HttpFileCollection files)
        {
            string myReturn = "";
            try
            {
                for (int iFile = 0; iFile < files.Count; iFile++)
                {
                    postedFile = files[iFile];
                    //获得文件的上传的路径 
                    localFilePath = postedFile.FileName;
                    //判断上传文件路径是否为空 
                    if (localFilePath == null || localFilePath == "")
                    {
                        //message("您没有上传数据呀,是不是搞错了呀!"); 
                        //break; 
                        continue;
                    }
                    else
                    {
                        #region 判断文件大小

                        //获得上传文件的大小 
                        localFileLength = postedFile.ContentLength;
                        //判断上传文件大小 
                        if (localFileLength >= sizes*1024)
                        {
                            message("上传的图片不能大于" + sizes + "KB");
                            break;
                        }

                        #endregion

                        #region 文件夹

                        //获取保存文件夹路径 
                        saveFileFolderPath = getSaveFileFolderPath(path);

                        #endregion

                        #region 文件名

                        //获得原文件名(含扩展名) 
                        localFileName = System.IO.Path.GetFileName(postedFile.FileName);
                        //获取原文件名不要扩展名
                        fileName = System.IO.Path.GetFileNameWithoutExtension(postedFile.FileName);

                        saveFileName = fileName + "_" +
                                       DateTime.UtcNow.ToString("yyyy" + "MM" + "dd" + "HH" + "mm" + "ss" + "ffffff");
                        //"yyyy"+"MM"+"dd"+"HH"+"mm"+"ss"+"ffffff" 

                        #endregion

                        #region 扩展名

                        //获取原文件扩展名 
                        localFileExtension = getFileExtension(localFileName);
                        //如果为真允许上传,为假则不允许上传 
                        if (localFileExtension == "")
                        {
                            message("目前本系统支持的格式为:" + fileType);
                            break;
                        }
                        //得到保存文件的扩展名,可根据需要更改扩展名 
                        saveFileExtension = localFileExtension;

                        #endregion

                        //得到保存文件的完整路径 
                        saveFilePath = saveFileFolderPath + saveFileName + saveFileExtension;

                        postedFile.SaveAs(saveFilePath);
                        message("文件上传成功");

                        myReturn = myReturn + ((myReturn == "" || myReturn == null) ? "" : "|") +
                                   path.TrimStart(new[] {' '}) + saveFileName + saveFileExtension;

                        //以下对文章的内容进行一些加工 
                        HttpContext.Current.Response.Write(
                            "<script>parent.Article_Content___Frame.FCK.EditorDocument.body.innerHTML+='<img src=" +
                            saveFileName + saveFileExtension + " " + " border=0 />'</SCRIPT>");
                    }
                }
            }
            catch
            {
                //异常 
                message("出现未知错误!");
                myReturn = null;
            }
            return myReturn;
        }

        #endregion

        #region getSaveFileFolderPath( ):获得保存的文件夹的物理路径

        /**/


        /// <summary>
        ///     获得保存的文件夹的物理路径
        ///     返回保存的文件夹的物理路径,若为null则表示出错
        /// </summary>
        /// <param name="format">保存的文件夹路径 或者 格式化方式创建保存文件的文件夹,如按日期"yyyy"+"MM"+"dd":20060511</param>
        /// <returns>保存的文件夹的物理路径,若为null则表示出错</returns>
        private string getSaveFileFolderPath(string format)
        {
            string mySaveFolder = null;
            try
            {
                string folderPath = null;
                //以当前时间创建文件夹, 
                //!!!!!!!!!!!!以后用正则表达式替换下面的验证语句!!!!!!!!!!!!!!!!!!! 
                if (format.IndexOf("yyyy") > -1 || format.IndexOf("MM") > -1 || format.IndexOf("dd") > -1 ||
                    format.IndexOf("hh") > -1 || format.IndexOf("mm") > -1 || format.IndexOf("ss") > -1 ||
                    format.IndexOf("ff") > -1)
                {
                    //以通用标准时间创建文件夹的名字 
                    folderPath = DateTime.UtcNow.ToString(format);
                    mySaveFolder = HttpContext.Current.Server.MapPath(".") + @"" + folderPath + @"";
                }
                else
                {
                    mySaveFolder = HttpContext.Current.Server.MapPath(".") + format;
                }
                var dir = new DirectoryInfo(mySaveFolder);
                //判断文件夹否存在,不存在则创建 
                if (!dir.Exists)
                {
                    dir.Create();
                }
            }
            catch
            {
                message("获取保存路径出错");
            }
            return mySaveFolder;
        }

        #endregion

        #region getFileExtension( ):获取原文件的扩展名

        /**/

        /// <summary>
        ///     获取原文件的扩展名,返回原文件的扩展名(localFileExtension),该函数用到外部变量fileType,即允许的文件扩展名.
        /// </summary>
        /// <param name="myFileName">原文件名</param>
        /// <returns>原文件的扩展名(localFileExtension);若返回为null,表明文件无后缀名;若返回为"",则表明扩展名为非法.</returns>
        private string getFileExtension(string myFileName)
        {
            string myFileExtension = null;
            //获得文件扩展名 
            myFileExtension = System.IO.Path.GetExtension(myFileName); //若为null,表明文件无后缀名; 
            //分解允许上传文件的格式 
            if (myFileExtension != "")
            {
                myFileExtension = myFileExtension.ToLower(); //转化为小写 
            }
            string[] temp = fileType.Split('|');
            //设置上传的文件是否是允许的格式 
            bool flag = false;
            //判断上传的文件是否是允许的格式 
            foreach (string data in temp)
            {
                if (("." + data) == myFileExtension)
                {
                    flag = true;
                    break;
                }
            }
            if (!flag)
            {
                myFileExtension = ""; //不能设置成null,因为null表明文件无后缀名; 
            }
            return myFileExtension;
        }

        #endregion

        #region message( ):弹出消息框

        /**/

        /// <summary>
        ///     弹出消息框,显示内容(msg),点击"确定"后页面跳转到该路径(url)
        /// </summary>
        /// <param name="msg">显示内容</param>
        /// <param name="url">跳转路径</param>
        private void message(string msg, string url)
        {
            HttpContext.Current.Response.Write("<script language=javascript>alert('" + msg + "');window.location='" +
                                               url + "'</script>");
        }

        /**/

        /// <summary>
        ///     弹出消息框,显示内容(msg),无跳转
        /// </summary>
        /// <param name="msg">显示内容</param>
        private void message(string msg)
        {
            HttpContext.Current.Response.Write("<script language=javascript>alert('" + msg + "');</script>");
        }

        #endregion
    }
}

后部署服务,用调试F5也行,如浏览http://10.24.68.63:8080/Upfile.aspx就可以啦


第二部分是在PDA中建一个应用程序

 首先在智能终端窗体应用项目中UploadFiles项目,添加window窗体Form1.cs

在Form1.cs中的代码:

using System;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Net;
using System.Text;
using System.Windows.Forms;

namespace UploadFiles
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        #region 事件
        /// <summary>
        /// 
        /// 选择文件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_selectFile_Click(object sender, System.EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();
            DialogResult res = openFileDialog1.ShowDialog();
            if (res.Equals(DialogResult.OK))
            {
                txtFileName.Text = openFileDialog1.FileName;
               
            }
        }
        /// <summary>
        /// 上传文件事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button_submit_Click(object sender, System.EventArgs e)
        {
            if (!txtFileName.Text.Trim().Equals(""))
            {
                //本地文件绝对路径
                string loadFile = txtFileName.Text.Trim();
                //获取文件名
                string serverPathName = loadFile.Substring(loadFile.LastIndexOf("\\")+1);
                //MessageBox.Show(serverPathName);
                string urlStr = @"http://10.24.68.63:8081/UploadFile.aspx?name=" + serverPathName;
                UploadFileBinary(loadFile, urlStr);
                MessageBox.Show("上传成功!!");
                txtFileName.Text = "";
            }
            else
            {
                string alStr = "您还没有选择文件";
                MessageBox.Show(alStr, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1);
            }
        }
        #endregion
        /// <summary>
        /// 上传文件
        /// </summary>
        /// <param name="localFile"></param>
        /// <param name="uploadUrl"></param>

        public void UploadFileBinary(string localFile, string uploadUrl)
        {
            try
            {
                FileStream rdr = new FileStream(localFile, FileMode.Open);
                byte[] inData = new byte[4096];
                int totbytes = 0;
                MemoryStream postData = new MemoryStream();
                int bytesRead = rdr.Read(inData, 0, inData.Length);
                while (bytesRead > 0)
                {
                    postData.Write(inData, 0, bytesRead);
                    bytesRead = rdr.Read(inData, 0, inData.Length);
                    totbytes += bytesRead;
                }
                rdr.Close();
                postData.Position = 0;
                HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uploadUrl);
                req.Method = "POST";
                req.ContentLength = (long)postData.Length;
                using (Stream s = req.GetRequestStream())
                {
                    s.Write(postData.ToArray(), 0, (int)postData.Length);
                    postData.Close();
                }
                WebResponse resp = req.GetResponse();
                resp.Close();
            }
            catch (Exception ex)
            {
                string exContent;
                exContent = ex.ToString();
                MessageBox.Show(exContent);
            }
        }
    }
}

其Form1.Designer.cs中的代码:

namespace UploadFiles
{
    partial class Form1
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        private System.Windows.Forms.MainMenu mainMenu1;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows 窗体设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.mainMenu1 = new System.Windows.Forms.MainMenu();
            this.btnDirectory = new System.Windows.Forms.Button();
            this.txtFileName = new System.Windows.Forms.TextBox();
            this.btnUpload = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // btnDirectory
            // 
            this.btnDirectory.Location = new System.Drawing.Point(160, 44);
            this.btnDirectory.Name = "btnDirectory";
            this.btnDirectory.Size = new System.Drawing.Size(72, 20);
            this.btnDirectory.TabIndex = 0;
            this.btnDirectory.Text = "目录";
            this.btnDirectory.Click += new System.EventHandler(this.button_selectFile_Click);
            // 
            // textBox1
            // 
            this.txtFileName.Location = new System.Drawing.Point(3, 44);
            this.txtFileName.Name = "txtFileName";
            this.txtFileName.Size = new System.Drawing.Size(138, 23);
            this.txtFileName.TabIndex = 1;
            // 
            // btnUpload
            // 
            this.btnUpload.Location = new System.Drawing.Point(160, 93);
            this.btnUpload.Name = "btnUpload";
            this.btnUpload.Size = new System.Drawing.Size(72, 20);
            this.btnUpload.TabIndex = 2;
            this.btnUpload.Text = "上传";
            this.btnUpload.Click += new System.EventHandler(this.button_submit_Click);
            //
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
            this.AutoScroll = true;
            this.ClientSize = new System.Drawing.Size(238, 265);
            this.Controls.Add(this.btnUpload);
            this.Controls.Add(this.txtFileName);
            this.Controls.Add(this.btnDirectory);
            this.Menu = this.mainMenu1;
            this.Name = "Form1";
            this.Text = "Form1";
            this.ResumeLayout(false);

        }

        #endregion

        private System.Windows.Forms.Button btnDirectory;
        private System.Windows.Forms.TextBox txtFileName;
        private System.Windows.Forms.Button btnUpload;
    }
}

然后新建一个Web项目:

new一个UploadFile.aspx

在UploadFile.aspx.cs的Page_Load方法中添加如下代码:

try
            {
                // 在此处放置用户代码以初始化页面
                byte[] theData = null;
                String ls_name;
                //if (Request.ServerVariables["REQUEST_METHOD"].ToUpper() == "GET")
                //{
                    theData = Request.BinaryRead(Request.ContentLength);
                    //获取文件名称
                    ls_name = Request.QueryString["name"];
                    //保存文件名
                    string fileName = DateTime.UtcNow.ToString("yyyy" + "MM" + "dd" + "HH" + "mm"+"ss") + "_"+ls_name;
                    var stm = new FileStream(Server.MapPath("./uploadFiles/" + fileName), FileMode.CreateNew);
                    stm.Write(theData, 0, theData.Length);
                    stm.Close();
                    Response.Write("测试1");
                //}
                //else
                //{
                //    Response.Write("测试2");
                //}
               
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);

            }

然后把UploadFile项目部署到PDA中,把上面的Web项目发布,即可


  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值