随笔分类 -  net基础

摘要:1 每次读取数据库的数据都是一个DataTable表,以前是傻傻的每个表都写一个转换的类,后来自己研究一个泛型方法,适用于所有转换 2 注意的地方 a: 数据库表的字段必须与实体一样否则反射的时候装载不了。 阅读全文
posted @ 2016-11-05 17:48 陌念 阅读(827) 评论(0) 推荐(0) 编辑
摘要:1、 循环插入 2 sql2008支持 insert into A("Name")values("dog"),("cat"),("d") 3使用类库SqlBlukCody 类进行高效插入 1万条不要1秒 DataTable dt = new DataTable(); dt.Columns.Add(" 阅读全文
posted @ 2016-02-25 10:30 陌念 阅读(371) 评论(0) 推荐(0) 编辑
摘要:1 在c#下自定义配置 1.1 配置文件下的配置 app.config不能更改名字 1.2 定义元素。集合类 class DCSSection : ConfigurationSectio... 阅读全文
posted @ 2016-01-08 20:22 陌念 阅读(564) 评论(0) 推荐(0) 编辑
摘要:图片效果1 创建Xm private void CreateXML_Click(object sender, EventArgs e) { XmlDocument doc = new XmlDocument(); XmlDeclara... 阅读全文
posted @ 2015-11-06 10:20 陌念 阅读(395) 评论(0) 推荐(0) 编辑
摘要:1. 第一步:下载安装包:官方下载地址←单击此处,如果是win系统,注意是64位还是32位版本的,请选择正确的版本。2. 第二步:新建目录“D:\MongoDB”,解压下载到的安装包,找到bin目录下面全部.exe文件,拷贝到刚创建的目录下。3. 第三步:在“D:\MongoDB”目录下新建“dat... 阅读全文
posted @ 2015-07-14 20:59 陌念 阅读(220) 评论(0) 推荐(0) 编辑
摘要:z1 客户端 //客户端 通信套接字 //1.创建监听套接字 使用 ip4协议,流式传输,TCP连接 Socket sokMsg = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.... 阅读全文
posted @ 2015-07-14 15:28 陌念 阅读(291) 评论(0) 推荐(0) 编辑
摘要:1 认识WebService 在 3,5 中新建一个服务应用程序 1 在asmx中 /// /// Service1 的摘要说明 /// [WebService(Namespace = "http://tempuri.org/")] //标注web服务器的命名空间,... 阅读全文
posted @ 2015-07-07 21:31 陌念 阅读(250) 评论(0) 推荐(0) 编辑
摘要:hei 70 t 是一个线程//这句话(t.Join();)在那个线程中执行,那么就阻塞了那个线程,那个线程要等待t线程执行完毕后,然后才会继续。 t.Join();//阻塞当前"主线程",等待t线程执行完毕后,继续主线程的执行。 t.Joi... 阅读全文
posted @ 2015-07-03 14:41 陌念 阅读(162) 评论(0) 推荐(0) 编辑
摘要:1 委托 存放函数安全指针2 步骤 /// /// 定义委托类型 /// public delegate void DGSayHi(string name); /// /// 生明委托变量 /// ... 阅读全文
posted @ 2015-07-03 14:40 陌念 阅读(120) 评论(0) 推荐(0) 编辑
摘要:1给一个方法添加过时的信息的时候 可以 [Obsolete("方法以及过时,请使用更好的算法EatNice()")] public string Eat() { return "吧唧吧唧的吃"; }编译一下就可以,下次... 阅读全文
posted @ 2015-07-03 14:39 陌念 阅读(150) 评论(0) 推荐(0) 编辑
摘要:1约束 /// /// 1.0 基类约束 ,约束成了T必须传入Pig本身或者其子类 /// /// public class PigHouse where T : Pig { /// /// 泛型方法使用的类型占位符使用的是泛型类中的... 阅读全文
posted @ 2015-07-03 14:38 陌念 阅读(147) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace RedisCall{ using ServiceSt... 阅读全文
posted @ 2015-06-22 18:53 陌念 阅读(693) 评论(0) 推荐(0) 编辑
摘要:private void button1_Click(object sender, EventArgs e) { //1.0 string str = "server=.;database=test;uid=sa;pwd=m... 阅读全文
posted @ 2015-06-22 14:19 陌念 阅读(209) 评论(0) 推荐(0) 编辑
摘要:1配置文件中 ... 阅读全文
posted @ 2015-06-22 14:17 陌念 阅读(214) 评论(0) 推荐(0) 编辑
摘要:1给一个方法添加过时的信息的时候 可以 [Obsolete("方法以及过时,请使用更好的算法EatNice()")] public string Eat() { return "吧唧吧唧的吃"; }编译一下就可以,下次... 阅读全文
posted @ 2015-04-11 11:48 陌念 阅读(156) 评论(0) 推荐(0) 编辑
摘要:C 货币2.5.ToString("C")¥2.50D 十进制数25.ToString("D5")00025E 科学型25000.ToString("E")2.500000E+005F 固定点25.ToString("F2")25.00G 常规2.5.ToString("G")2.5N 数字2500000.ToString("N")2,500,000.00X 十六进制255.ToString("X")FFformatCode 是可选的格式化代码字符串。(详 阅读全文
posted @ 2014-03-09 11:30 陌念 阅读(566) 评论(0) 推荐(0) 编辑
摘要:1 二个方法比较重要 //网站运行后只会运行一次 不管换不换浏览器都不回执行 protected void Application_Start(object sender, EventArgs e) { HttpContext.Current.Application["web"] = "我只会执行一次" + DateTime.Now;//在页面中输出的时候 Response.Write(Application["web"].ToString()); } /// /// 出现页面... 阅读全文
posted @ 2014-03-04 23:10 陌念 阅读(170) 评论(0) 推荐(0) 编辑
摘要:1 新建个类库 添加 system.web的应用2 实现IHttpModule的接口using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Web;namespace FirstModule{ class FirstModule :System.Web.IHttpModule {//为请求管道的第一个事件 ,也是就BeginRequest 的事件注册一个用户自动以的一个方法 public void Init(HttpApplicatio... 阅读全文
posted @ 2014-03-03 23:39 陌念 阅读(158) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Xml;using System.IO;namespace Comp.WEB.Xml{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, Even... 阅读全文
posted @ 2014-03-02 21:52 陌念 阅读(221) 评论(0) 推荐(0) 编辑
摘要:1 最基础的using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Reflection;namespace _05反射{ class Program { static void Main(string[] args) { #region 通过反射获取成员 ////反射中的重要类:Type //Person p = new Person(); ... 阅读全文
posted @ 2014-03-02 21:46 陌念 阅读(229) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示