http://dotnet.aspx.cc/ShowDetail.aspx?id=58EA3515-36F2-4FD9-AC89-EAF49F59816C

解决方案 »

  1.   

    <%@ Import Namespace="System.IO" %>
    <html>
    <head>
    <title>文件上传</title>
    <script language="C#" runat="server">
      void Upload_Click(object sender,EventArgs E)
      {
        if(myFile.PostedFile!=null)
        {
         try
         {
          string fileDir="c:\\aMao"; //注此处可更改为你想要上传的目录
          string fileName=System.IO.Path.GetFileName(myFile.PostedFile.FileName);
          string filePath=System.IO.Path.Combine(fileDir,fileName);
          myFile.PostedFile.SaveAs(filePath);
          }
          catch(Exception exc)
          {
          Response.Write("<br>"+exc.Message);
          }
         }
      }
      </script>
    </head>
    <body>
     <form id=form1 enctype="multipart/form-data" runat="Server">
      Select a file to upload.<br>
     <input type="file" ID="myFile" runat="Server">
     <input type="button" ID="Upload" value="Upload" OnServerClick="Upload_Click" runat="server">
    </form> 
    </body>
    </html>
      

  2.   

    http://www.lionsky.net/MyWebsite/downsoft/List.Aspx?id=222