Using sw As StreamWriter = New StreamWriter(filePath)
                        For i As Integer = 0 To csvValue.Count - 1
                            sw.WriteLine(csvValue(i).ToString())
                        Next
                        sw.Close()
                    End Using这的filePath是指定的!我想用下载的提示框实现!让用户自己选该如何操作

解决方案 »

  1.   

    自己解决了!Private Sub download(ByVal name As String)
            Dim df As FileInfo = New FileInfo(name)
            Response.Clear()
            Response.ClearHeaders()
            Response.Buffer = False
            Response.ContentType = "application/octet-stream"
            Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(df.FullName, System.Text.Encoding.UTF8))
            Response.AppendHeader("Content-Length", df.Length.ToString())
            Response.WriteFile(df.FullName)
            Response.Flush()
            'Response.End()//为了把生成的文件删除所以去掉了这句!不然程序跑到这就停止了
        End Sub
      

  2.   

    做成流方式的下载,自动会弹出选择路径,或者用activx控件