C#
文章平均质量分 80
会飞De琥珀
这个作者很懒,什么都没留下…
展开
-
C#动态创建DataTable
DataTable tblDatas = newDataTable("Datas");DataColumn dc = null;//赋值给dc,是便于对每一个datacolumn的操作dc =tblDatas.Columns.Add("ID",Type.GetType("System.Int32"));dc.AutoIncrement= true;//自动增加dc.AutoIncre转载 2014-11-13 11:09:29 · 2106 阅读 · 0 评论 -
[C#][正则]判断字符串是否是数字
private bool IsNumber(string s) { if (string.IsNullOrWhiteSpace(s)) return false; const string pattern = "^[0-9]*$"; Regex rx = new Regex(pattern); return rx.IsMatch(s);}...转载 2019-05-05 14:49:38 · 1104 阅读 · 0 评论 -
[C#][页面]获取当前页面的url信息
测试url : http://www.test.com:80/aaa/a.aspx?id=5&name=yh【1】获取 完整url (协议名+域名+站点名+文件名+参数)string url=Request.Url.ToString();【2】获取 域名:string url=HttpContext.Current.Request.Url.Host;【3】获取 端口:i...转载 2018-09-13 09:06:27 · 1059 阅读 · 0 评论 -
[C#][下载] http下载文件
原文:https://www.cnblogs.com/testsec/p/6095713.html/// <summary> /// http下载文件 /// </summary> /// <param name="url">下载文件地址</param> /// <param...转载 2018-08-23 09:50:23 · 3222 阅读 · 0 评论 -
[C#] Linq常用语法
<strong>Linq常用语法</strong> Student[] student = { new Student{ID=1, Name="小黑",Age=3,Class=1}, new Student{ID=2,Name="小布",Age=5,Class=1}, ...原创 2018-07-13 15:54:53 · 1283 阅读 · 0 评论 -
DataTable和list转换
原文:http://blog.csdn.net/educast/article/details/5256137转载 2016-08-25 16:48:44 · 446 阅读 · 0 评论 -
C# 汉字转拼音
C# 汉字转拼音转载 2016-09-01 16:27:04 · 1836 阅读 · 0 评论 -
C#读写txt文件的两种方法介绍
C#读写txt转载 2016-08-31 12:54:06 · 915 阅读 · 0 评论 -
C# 获取汉字拼音首字母
/// /// 在指定的字符串列表CnStr中检索符合拼音索引字符串 /// /// 汉字字符串 /// 相对应的汉语拼音首字母串 public static string GetSpellCode(string CnStr) { string strTemp=""; int iLen=CnStr.Length; int i=0; for (i=0;i<=iLen-1;i转载 2016-08-31 12:38:51 · 653 阅读 · 0 评论 -
asp.net写入日志到文本文件
asp.net写入日志到文本文件using System;using System.Collections.Generic;using System.Web;using System.IO;using System.Text;/// /// Summary description for NetLog/// public class NetLog{ ///转载 2016-06-23 09:03:41 · 573 阅读 · 0 评论 -
DataTable 转 IEnumerable
public class TableTools { /// /// DataTable 转换为List 集合 /// /// 类型 /// DataTable /// public static List ToList(DataTable dt) where TResult转载 2016-07-01 10:10:03 · 2775 阅读 · 0 评论 -
Jquery绑定Select下拉菜单
需要返回JSon数据集。 ASPX: $.ajax({ type: "POST", contentType: "application/json;utf-8", data: "{strclassid:'" + strclassid + "'}", url: "/AutoService.asmx/Show", success: function (msg) { var myObje转载 2014-12-11 11:51:33 · 2052 阅读 · 0 评论 -
json 操作
格式校验推荐:https://www.json.cn/JS操作新增数据var arr =[{"name":"CC","sex":"男"}];arr[0].age='03'//结果{name: "CC", sex: "男", age: "03"}对象操作//往对象的末尾添加一个对象arr.push({ name:'CC', sex:'男', ...原创 2019-06-13 11:53:43 · 123 阅读 · 0 评论