Response.write("变量+字符串+变量");这个格式怎么写是正确的。请说说????谢谢!

解决方案 »

  1.   

    Response.Write(变量+"字符串"+变量);
      

  2.   

    Response.write(var1+"字符串的内容"+var2);
    其中var1、var2是你要拼接的两个变量的名称
      

  3.   

    int i = 1;
            int j = 2;
            Response.Write(j + "aa" + i);
      

  4.   

    string varable="变量";
    response.write("alert('"+varable+"');");
      

  5.   


    int a=1;
    int b=1;
    Response.write(a.ToString()+"dddd"+b.ToString());
      

  6.   

    string temp1 = "1";
                    string temp2 = "2";
                    Response.Write(string.Format("{0}dfsfsd{1}", temp1, temp2));
    输出:
    1dfsfsd2 
      

  7.   


    方法1  TransmifFile
    方法2  Response.WriteFile
    方法3  OutputStream.Write分块下载文件
    方法4  使用Response.BinaryWrite 仅适合于小文件,如果大文件,要结合分块办法
      

  8.   


    刷哥!就算用你这些方法总得先说个下载的逻辑性吧。。
    方法是次要的给我逻辑COME ON
      

  9.   

    哈哈.
    首先从数据库中得到文件名及路径,下面以当前目录的007.rar为例        private string fileName = HttpContext.Current.Server.UrlEncode("007.rar");   
            private string filePath = HttpContext.Current.Server.MapPath("007.rar");   
        protected void downx(object sender, EventArgs e)
        {
              FileInfo info = new FileInfo(filePath);   
                long fileSize = info.Length;   
                Response.Clear();
                Response.ContentType = "application/octet-stream";   
                Response.AddHeader("Content-Disposition", "attachment;filename="+ fileName);   
                Response.AddHeader("Content-Length", fileSize.ToString());   
               Response.WriteFile(filePath, 0, fileSize);   
                Response.Flush();   
                Response.Close();   
        }