• λ我爱Aspx >> Asp.Net >> 一个文件上传的类
  • 一个文件上传的类

  • :未知  Դ:internet  :2007-5-20 16:44:41  ؼ:
  • namespace Wmj

    {

    public class MyUpload

    {

    private System.Web.HttpPostedFile postedFile=null;

    private string savePath="";

    private string extension="";

    private int fileLength=0;

    //显示该组件使用的参数信息

    public string Help

    {

    get{

    string helpstring;

    helpstring="<font size=3>MyUpload myUpload=new MyUpload(); //构造函数";

    helpstring+="myUpload.PostedFile=file1.PostedFile;//设置要上传的文件";

    helpstring+="myUpload.SavePath=\"e:\\\";//设置要上传到服务器的路径,默认c:\\";

    helpstring+="myUpload.FileLength=100; //设置上传文件的最大长度,单位k,默认1k";

    helpstring+="myUpload.Extension=\"doc\";设置上传文件的扩展名,默认txt";

    helpstring+="label1.Text=myUpload.Upload();//开始上传,并显示上传结果</font>";

    helpstring+="<font size=3 color=red>Design By WengMingJun 2001-12-12 All Right Reserved!</font>";

    return helpstring;

    Ҷƪл˵?
  • һƪASP.NET中使用Caching
    һƪ继承System.Web.UI.Page的页面基类