乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      將數(shù)據(jù)導(dǎo)入Excle

       實力決定地位 2010-04-24
       protected void Button1_Click(object sender, EventArgs e)
          {
             // List<LoginLog> lis = new List<LoginLog>();
           // string sql = "select top 10 * from LoginLog where loginid not in (select top (10 * (@cuttpager-1)) loginid from LoginLog order by loginid) order by loginid";
             // string path= ExCEl.query_table_getdata(@"D:/tex/text/Excle/",sql);
           //  DataTable tb = DBHper.GetTable(sql,new SqlParameter("@cuttpager",pager));
              List<LoginLog> list = LoginLogService.GetList2(pager);

             
              string str = "<table width=100% border=1 bgcolor=black cellspacing=1>";
              str += "<tr bgcolor=yellow>";
              str += "<td width=100px style='text-align:center '>" + "登陸ID" + "</td>";
              str += "<td width=100px style='text-align:center '>" + "用戶名稱" + "</td>";
              str += "<td width=100px style='text-align:center '> " + "登陸時間" + "</td>";
              str += "<td width=100px style='text-align:center '>" + "登陸IP" + "</td>";
              str += "<td width=100px style='text-align:center '>" + "登陸時候成功" + "</td>";
              str += "<td width=100px style='text-align:center '>" + "登陸描述" + "</td>";
              str += "</tr>";
              foreach (LoginLog log in list)
              {
                  str += "<tr bgcolor=white>";
                  str += "<td width='100px' style='text-align:center '>" + log.LoginId + "</td>";
                  str += "<td width='100px' style='text-align:center '>" + log.UserId + "</td>";
                  str += "<td width='100px' style='text-align:center '>" + log.LoginTime + "</td>";
                  str += "<td width='100px' style='text-align:center '>" + log.LoginUserIp + "</td>";
                  if (log.IfSuccess == 1)
                  {
                      str += "<td width='100px' style='text-align:center '>" + "成功" + "</td>";
                  }
                  else
                  {
                      str += "<td width='100px' style='text-align:center '>" + "失敗" + "</td>";
                  }
                 
                  str += "<td width='100px' style='text-align:center '>" + log.LoginDesc + "</td>";
                  str += "</tr>";
              }
              str += "</table>";
              using (StreamWriter writer = new StreamWriter(Server.MapPath("~/Excle/TextFile.xls"), false, System.Text.Encoding.Default))
              {
                  writer.WriteLine(str);
                  Response.Redirect("~/Excle/TextFile.xls");
              }
       
      }
      這是一個簡單的將數(shù)據(jù)導(dǎo)入Excle的例子
             

        本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評論

        發(fā)表

        請遵守用戶 評論公約