c#目录控件

来源:百度知道 编辑:UC知道 时间:2024/06/19 10:50:59
VS2005中有没有一个浏览文件夹创建文件这种功能的控件,可以选择目录直接创建文件,如何使用,还有在如何本机而不是服务器上生成文件的代码

你QQ不在线了啊。
可以在服务器上生成文件,再下载,然后删除服务器上的文件。
给你个下载的类,你研究一下。
private static bool downfile(System.Web.HttpResponse response, string filename, string fullpath)
{
try
{
response.ContentType = "application/octet-stream";

response.AppendHeader("content-disposition", "attachment;filename=" +
HttpUtility.UrlEncode(filename, System.Text.Encoding.UTF8) + ";charset=gb2312");
System.IO.FileStream fs = System.IO.File.OpenRead(fullpath);
long flen = fs.Length;
int size = 102400;//每100k同时下载数据
byte[] readdata = new byte[size];//指定缓冲区的大小
if (size > flen) size = Convert.ToInt32(flen);
long fpos = 0;
bool isend = false;
while (!isend)
{
if ((fpos + size) > flen)
{