日期:2014-05-19  浏览次数:20879 次

ASP.net如何在客户端生成txt文件--急!请各位大虾帮帮忙
ASP.net如何在客户端生成文件到指定目录
例如
    服务器用File.Create
  public   static   void   Main()  
        {
                string   path   =   @ "c:\temp\MyTest.txt ";

                //   Delete   the   file   if   it   exists.
                if   (File.Exists(path))  
                {
                        File.Delete(path);
                }

                //   Create   the   file.
                using   (FileStream   fs   =   File.Create(path,   1024))  
                {
                        Byte[]   info   =   new   UTF8Encoding(true).GetBytes( "This   is   some   text   in   the   file. ");
                        //   Add   some   information   to   the   file.
                        fs.Write(info,   0,   info.Length);
                }
        }
这只能在服务器生成文件
我想生成到客户端应该怎么写啊?

------解决方案--------------------
你没有往客户端写的权限,采用
http://www.itlearner.com/article/2005/2375.shtml
------解决方案--------------------
asp.net可以弹出下载框的那种。必须放开写的权限。不安全