小结2022年3月
1.隐藏元素的形式
<div hidden = "hidden"></div>
或者
<div hidden></div>
2.判断复选框是否被选中
$(‘#input’).is(“:checked”)
$(‘input’).prop(‘checked’)
3.HashTable类型
可以存放object类型的对象
HashTable hs = new HashTable();
//
string str= "abc";
IList<string> List= new List<string>();
hs.Add("List", str);
hs.Add("List", List);
4.cshtml中Model
cshtml 中 不加分号
@model FirstModel
//代码文件上方 引入model时,不需要再model实例后面加分号“;”
5.按小时递推
for (DateTime titem = start; titem <= endtime; titem = titem.AddHours(1))
{
if (titem.Hour % hours == 0)
{
ycyscount++;
}
}
6.===
三个等号
===
是javascript内置的一个比较运算符,用于在逻辑语句中,测定变量或值是否绝对等于,即值和类型均相等;“===”运算符会先比较两边变量数据类型是否相等,然后比较两边变量的数值是否相等;只有数据类型和数值都相等,才返回true。
7.数组去重
- includes()方法用来判断一个数组是否包含一个指定的值,如果是返回 true,否则false。当fromIndex 参数负值,则按升序从 array.length + fromIndex 的索引开始 搜索
///
var arr = [1,2,3,4];
arr.includes(1,-1); //false
arr.includes(2,-4); //true
- IndexOf
8.NPOI读取Excel
WOOKBook读取Excel数据
WookBook wb = new WookBook(filePath);
9.SqlBulkCopy批量插入数据库