本帖最后由 guyi5 于 2013-05-17 21:42:29 编辑

解决方案 »

  1.   

    可以试试用上传文件的控件FileUpload
      

  2.   

    除非使用activex插件,否则办不到。
      

  3.   

    就是不用FileUpload,实现他的那种效果来选择文件
      

  4.   

    可以写 原生的 INPUT(type=File 然后 
        protected void BtnUpFiles_Click(object sender, EventArgs e)//多文件上传
        {
            StringBuilder strMessage = new StringBuilder();
            HttpFileCollection Files = HttpContext.Current.Request.Files;
            for (int i = 0; i < Files.Count; i++)
            {
                HttpPostedFile PostedFile = Files[i];
                if (PostedFile.ContentLength > 0)
                {
                    string FileName = PostedFile.FileName;
                    string strExPrentFile = FileName.Substring(FileName.LastIndexOf(".") + 1);
                    string[] NoExPrentFile = new string[] { "exe", "asp", "php" };
                    bool IsUp = true;
                    for (int j = 0; j < NoExPrentFile.Length; j++)
                    {
                        if (strExPrentFile.Equals(NoExPrentFile[j]))
                        {
                            IsUp = false;
                        }
                    }
                    if (IsUp)
                    {                    string sFilePath = string.Format("files/{0}.{1}", DateTime.Now.ToString("mmhhddss"), strExPrentFile);
                        PostedFile.SaveAs(Server.MapPath(sFilePath));
                        strMessage.Append("文件上传成功!");
                        strMessage.Append(string.Format("{0}.{1}", DateTime.Now.ToString("mmhhddss"), strExPrentFile));
                        strMessage.Append("<br />");
                        strMessage.Append("文件的格式:");
                        strMessage.Append(strExPrentFile);
                        strMessage.Append("<br />```````````````<br />");
                        //this.LabMessage.Text = "文件上传成功!" + "<br />文件名是:" + string.Format("{0}.{1}", DateTime.Now.ToString("mmhhddss"), strExPrentFile) + "<br />文件的格式:" + strExPrentFile;
                    }
                    else
                    {
                        //this.LabMessage.Text = string.Format("不允许上传{0}格式文件", NoExPrentFile);
                    }
                }
                else
                {
                    //this.LabMessage.Text = "不能上传空文件";
                }
            }
            this.LabMessage.Text = strMessage.ToString();
        }
      

  5.   

    jquery uploadify
      

  6.   

    直接写就可以了啊,我刚刚实现了<html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>上传</title>
         <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
        <script type="text/javascript">
            $(function () {
                $("#sub").click(function () {
                    $("#f1").click();
                    $("#f1").val
                })
            })
        </script>
    </head>
    <body>
        <asp:FileUpload ID="FileUpload1" runat="server" />
        <input id="f1" type="file" style=" width:1px; height:1px;" />
        <input id="sub" type="submit" value="上传" />
    </body>
    </html>