td

json接口导入添加数据库

。_饼干妹妹 提交于 2019-12-02 22:38:55
public ActionResult AAA() { return View(); } [HttpGet] public string A() { HttpClient client = new HttpClient(); var aaa = client.GetStringAsync("https://www.layui.com/test/table/demo1.json"); var bbb = aaa.Result; var json = JsonConvert.DeserializeObject<Class1>(bbb); var data= json.data; for (int i = 0; i < data.Count(); i++) { string sql = "INSERT INTO [dbo].[KuaYu]([id],[username],[email],[sex],[city],[sign],[experience],[ip],[logins],[joinTime]) VALUES(@id,@username,@email,@sex,@city,@sign,@experience,@ip,@logins,@joinTime)"; SqlParameter[] pa = new SqlParameter[] { new SqlParameter("@id"

Excel导入导出数据库(MVC)

℡╲_俬逩灬. 提交于 2019-12-02 22:38:14
后端 using Dapper; using Newtonsoft.Json; using NPOI.HSSF.UserModel; using NPOI.SS.UserModel; using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; using System.Diagnostics; using System.IO; using System.Linq; using System.Web; using System.Web.Mvc; using static Test.SqlConCty; namespace Test.Controllers { public class HomeController : Controller { public ActionResult Index() { return View(); } // GET: UploadExcel public ActionResult TestExcel(string filePath) { return View(); } /// <summary> /// 根据Excel列类型获取列的值 /// </summary> /// <param name="cell"

Excel接口导出,导入数据库(.Net)

假装没事ソ 提交于 2019-12-02 22:37:27
public ActionResult TestExcel(string filePath) { return View(); } /// <summary> /// 根据Excel列类型获取列的值 /// </summary> /// <param name="cell">Excel列</param> /// <returns></returns> private static string GetCellValue(ICell cell) { if (cell == null) return string.Empty; switch (cell.CellType) { case CellType.Blank: return string.Empty; case CellType.Boolean: return cell.BooleanCellValue.ToString(); case CellType.Error: return cell.ErrorCellValue.ToString(); case CellType.Numeric: case CellType.Unknown: default: return cell.ToString(); case CellType.String: return cell.StringCellValue; case CellType

C# 解析Xml接口

折月煮酒 提交于 2019-12-02 22:18:51
1 public string GetWeather() 2 { 3 string weatherXML = GetRequestData("http://flash.weather.com.cn/wmaps/xml/china.xml?spm=a2c4e.10696291.0.0.5c5019a4nz9oyZ&file=china.xml"); 4 XmlDocument xml = new XmlDocument(); 5 xml.LoadXml(weatherXML); 6 XmlNode root = xml.SelectSingleNode("china"); 7 var list = Newtonsoft.Json.JsonConvert.SerializeXmlNode(root); 8 XmlNodeList childlist = root.ChildNodes; 9 return list; 10 } 11 12 public static string GetRequestData(string sUrl) 13 { 14 //使用HttpWebRequest类的Create方法创建一个请求到uri的对象。 15 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sUrl); 16 /

JQPRINT-不错的jquery打印插件

匿名 (未验证) 提交于 2019-12-02 21:53:52
1、首先引用Jquery和jqprint-0.3.js(依赖于Jquery的) 2、Hmtl代码 <div id="print-area"> <table> <tr> <td>test</td> <td>test</td> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> <td>test</td> <td>test</td> </tr> <tr> <td>test</td> <td>test</td> <td>test</td> <td>test</td> <td>test</td> </tr> </table> </div> <input type="button" onclick=" print()" value="打印"> 3、JavaScript代码 <script language="javascript">

JQuery案例二:实现全选、全不选和反选

匿名 (未验证) 提交于 2019-12-02 21:53:52
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>全选和全不选以及反选</title> <script src="../js/jquery-1.8.3.js"></script> <script> $(function() { //全选事件 $("#checkedAll").click(function() { $(".checkedOne").attr("checked",this.checked); }); $("#reSelect").click(function() { $(".checkedOne").each(function() { this.checked = !this.checked; }); }); }); </script> </head> <body> <table id="tbl" border="1" border-collapse="collapse" align="center" cellspacing="0" cellpadding="5" width="400" height="20"> <thead> <tr> <th><input type = "checkbox" id="checkedAll">全选</input></th> <th>编号</th><th>姓名</th

JQuery案例一:实现表格隔行换色

匿名 (未验证) 提交于 2019-12-02 21:53:52
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title>使用JQ完成表格隔行换色</title> <script src="js/jquery.min.js"></script> <script> $(function() { $("tbody tr:odd").css("background-color","aquamarine"); $("tbody tr:even").css("background-color","bisque"); var tb = $("tbody tr"); var oldColor; for(var i=0;i<tb.length;i++) { //alert(oldColor); $("tbody tr")[i].onmouseover = function() { oldColor = this.style.backgroundColor; this.style.backgroundColor = "yellow"; } $("tbody tr")[i].onmouseout = function() { this.style.backgroundColor = oldColor; } } }); </script> </head> <body> <table id="tbl"

用jQuery编写简单九宫格抽奖

匿名 (未验证) 提交于 2019-12-02 21:53:52
1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta name="viewport" content="width=device-width, initial-scale=1.0"> 7 <meta http-equiv="X-UA-Compatible" content="ie=edge"> 8 <title>Document</title> 9 <style> 10 table { 11 width: 600px; 12 height: 600px; 13 border: 2px solid black; 14 margin: 0 auto; 15 border: 2px solid black; 16 17 } 18 19 table td { 20 border: 2px solid black; 21 width: 200px; 22 text-align: center; 23 } 24 25 p { 26 text-align: center; 27 height: 10px; 28 } 29 30 span { 31 color: red; 32 } 33 34 #star { 35 /* background: gray; */ 36 font-size:

JavaScript表格的隔行换色开发

匿名 (未验证) 提交于 2019-12-02 21:53:52
Html代码: <! DOCTYPE html > < html > < head > < meta charset ="UTF-8" > < title > 隔行换色 </ title > </ head > < body > < table id ="tab1" border ="1" width ="800" align ="center" > < tr style ="background-color: #999999;" align ="center" > < th > 分校ID </ th > < th > 分校地区 </ th > < th > 操作 </ th > </ tr > < tr align ="center" > < td > 1 </ td > < td > 济南分校 </ td > < td >< a href ="" > 修改 </ a > | < a href ="" > 删除 </ a ></ td > </ tr > < tr align ="center" > < td > 2 </ td > < td > 昆山分校 </ td > < td >< a href ="" > 修改 </ a > | < a href ="" > 删除 </ a ></ td > </ tr > < tr align ="center" > < td > 3