zoukankan      html  css  js  c++  java
  • 图片上传的例子

    .cs

    private int uploadpic()
      {
      
       if(myFile.PostedFile!=null)
       {
        try
        {
         string fileDir="C://Library//PagePic//"; //注此处可更改为你想要上传的目录
         string fileName=System.IO.Path.GetFileName(myFile.PostedFile.FileName);
         string filePath=System.IO.Path.Combine(fileDir,fileName);
         LfikePath.Text=filePath;
         myFile.PostedFile.SaveAs(filePath);
        }
        catch(Exception exc)
        {
         this.AlertBox(exc.Message);
         return -1;
         
         
        }
       }

       return 0;
      
      
      
      }

     private void BSubmit_Click(object sender, System.EventArgs e)
      {
       
       if(uploadpic()==-1)
       {
       return;
       
       }
       
      }

      

    .aspx

     <<INPUT id="myFile" type="file" onchange="document.all.Ifytp.src=this.value" runat="server">>
    <<asp:image id="Ifytp" runat="server" Width="72px">><</asp:image>>

  • 相关阅读:
    grub损坏修复方法
    基本命令(一)
    python 及 ipython 源码安装
    Samba服务安装配置
    shell语法一
    cacti监控软件
    Telnet服务安装及配置
    LVM逻辑卷,RAID磁盘阵列
    运维笔试题4(转载)
    运维笔试题3(转载)
  • 原文地址:https://www.cnblogs.com/superch0054/p/4010264.html
Copyright © 2011-2022 走看看