如题
怎么样实现附件下载该使用什么控件
WEB

解决方案 »

  1.   

    把超级链接指向非Html等的文件,点击的时候就会下载
      

  2.   

    楼主是要在哪里实现?html
    ?
      

  3.   

    不知道如下的代码能否帮到你: private void DownloadFile(string fileName)
    {
    string saveFile = System.IO.Path.GetFileName(fileName); string extName = System.IO.Path.GetExtension(fileName);
    RegistryKey rootKey, extKey;
    string contentType = "application/unknown"; rootKey = Registry.ClassesRoot;
    extKey = rootKey.OpenSubKey(extName);
    if (extKey != null)
    {
    contentType = extKey.GetValue("Content Type", contentType).ToString();
    } Response.Clear();
    Response.Buffer = true;
    Response.AppendHeader("Content-Disposition", "attachment;filename=" + saveFile);
    Response.ContentType = contentType; Response.WriteFile(fileName); Response.Flush();
    Response.Close();
    }
      

  4.   

    谢谢楼上的朋友们
    hbxtlhx 我用的就是你说的这种。虽然已经解决 但是很感谢。