用.net中system.io
就是文件的操作完全可以实现你说的那些功能

解决方案 »

  1.   

    你要生成的htm文件它的来源是哪? 不会只是拷贝吧?
      

  2.   

    假设你的数据是从数据库里面来的,这有一个例子:
    FileInfo htmFile;
    TextWriter outText=null;

    for(int i=0;i<100;i++)
    {
    htmName="test"+i.ToString()+".htm";
    htmFile=new FileInfo(Server.MapPath(htmName));

    outText=htmFile.CreateText();
    remote.CreateHtm("selectPrint2",Convert.ToInt32("1"),strCssFile,"name","sex");
    outText.WriteLine(remote.HtmCode);
    outText.Flush();
    }public string CreateHtm(string process,int id,string cssFile,params string[] fields)
    {
    htmCode="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">";
    htmCode+="<link href=";
    htmCode+=cssFile;
    htmCode+="  rel=\"stylesheet\" type=\"text/css\">";
    htmCode+="<body topmargin=\"0\" leftmargin=\"0\">";
    htmCode+="<div class=\"block\"><table width='500' border='0' align='center' cellpadding='3' cellspacing='1'>"; try
    {
    SqlCommand cmdSelect=new SqlCommand(process,cnn);
    cmdSelect.CommandType = CommandType.StoredProcedure;
    cmdSelect.Parameters.Add("@id",Convert.ToInt32("1"));
    cnn.Open();
    dr=cmdSelect.ExecuteReader(); while(dr.Read())
    {

    foreach(string field in fields)
    {
    i++;
    } for(int j=0;j<m;)
    {
    htmCode+="<tr><td width=250>";
    htmCode+=dr[fields[j].ToString()].ToString();
    j++;
    htmCode+="</td><td width=250>";
    htmCode+=dr[fields[j].ToString()].ToString();
    j++;
    htmCode+="</td></tr>";
    } htmCode+="</table></div></body>";
    }//while
    }
    finally
    {
    cnn.Close();
    }

    }//BuildTable就是用一个循环创建文件然后写入数据
      

  3.   

    shixueli(渴望成功),您的源码不是很全啊,能不能帖稍微完整些的。
    比如HtmCode是哪来的?
      

  4.   

    ;;; -----------------------------------------------------------
    以上文字、图由易我秀输出,你也想这么酷吗?
    http://www.eoshow.com/download/install1.html