导航

08 2017 档案

摘要:一、传统 ajax跨域访问是一个老问题了,解决方法很多,比较常用的是JSONP方法,JSONP方法是一种非官方方法,而且这种方法只支持GET方式,不如POST方式安全。 即使使用jQuery的jsonp方法,type设为POST,也会自动变为GET。 官方问题说明: "script": Evalua 阅读全文

posted @ 2017-08-30 09:10 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Net; 6 using System.Net.Security; 7 using System.Security.Cryptography.X509Cer... 阅读全文

posted @ 2017-08-30 07:00 清浅ヾ

摘要:public 维护所有默认权限 db_owner 执行所有数据库角色活动 db_accessadmin 添加和删除数据库用户, 组及角色 db_ddladmin 添加、更改或删除数据库对象 db_security admin 分配语句执行和对象权限 db_backupoperator 备份数据库 d 阅读全文

posted @ 2017-08-26 04:33 清浅ヾ

摘要:DBCC DROPCLEANBUFFERS:从缓冲池中删除所有缓存,清除缓冲区 在进行测试时,使用这个命令可以从SQLSERVER的数据缓存data cache(buffer)清除所有的测试数据,以保证测试的公正性。 需要注意的是这个命令只移走干净的缓存,不移走脏缓存。由于这个原因,在执行这个命令前 阅读全文

posted @ 2017-08-26 04:22 清浅ヾ

摘要:正文 要想成功访问 SQL Server 数据库中的数据, 我们需要两个方面的授权: 假设,我们准备建立一个 dba 数据库帐户,用来管理数据库 mydb。 1. 首先在 SQL Server 服务器级别,创建登陆帐户(create login) 登陆帐户名为:“dba”,登陆密码:abcd1234 阅读全文

posted @ 2017-08-26 04:00 清浅ヾ

摘要:一、定义一个缓存接口IChace 二、定义一个MyCache类用来封装MemoryCache的基本业务,实现缓存接口IChace 三、定义一个CacheManager类来管理不同的缓存对象,上端主程序直接调用该类进行业务缓存 阅读全文

posted @ 2017-08-24 05:52 清浅ヾ

摘要:主程序调用 执行结果 阅读全文

posted @ 2017-08-22 21:19 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Security.Cryptography; 6 using System.Text; 7 using System.Threading.Tasks; 8 9 na... 阅读全文

posted @ 2017-08-21 22:34 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Security.Cryptography; 6 using System.Text; 7 using System.Threading.Tasks; 8 9 na... 阅读全文

posted @ 2017-08-21 22:33 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.IO; 4 using System.Linq; 5 using System.Security.Cryptography; 6 using System.Text; 7 using System.Threading.Tasks; 8 9 na... 阅读全文

posted @ 2017-08-21 22:32 清浅ヾ

摘要:封装的增删改查类SqlHelper 实现接口: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace ADO.NET 7 { 8 publ 阅读全文

posted @ 2017-08-21 13:50 清浅ヾ

摘要:在windows窗体程序中,使用 ThreadException 事件来处理 UI 线程异常,使用 UnhandledException 事件来处理非 UI 线程异常。ThreadException可以阻止应用程序终止。具体使用方法如下: 阅读全文

posted @ 2017-08-20 00:30 清浅ヾ

摘要:处理未捕获的异常是每个应用程序起码有的功能,C#在AppDomain提供了UnhandledException 事件来接收未捕获到的异常的通知。常见的应用如下: 阅读全文

posted @ 2017-08-20 00:28 清浅ヾ

摘要:下面是一些Model类 1 class Student 2 { 3 public int id { get; set; } 4 public string name { get; set; } 5 public int age { get; set; } 6 } 7 8 class ClassStu 阅读全文

posted @ 2017-08-18 15:00 清浅ヾ

摘要:上端主程序调用 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace LinqToSql 7 { 8 class Program 9 { 阅读全文

posted @ 2017-08-18 09:58 清浅ヾ

摘要:上端调用下端的实例 下面是几个类的实例 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 反射 7 { 8 class People< 阅读全文

posted @ 2017-08-18 07:33 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 缓存 7 { 8 class Program 9 { 10 static void Main(string[] args) 11 ... 阅读全文

posted @ 2017-08-16 18:33 清浅ヾ

摘要:Monitor对象 1.Monitor.Enter(object)方法是获取锁,Monitor.Exit(object)方法是释放锁,这就是Monitor最常用的两个方法,当然在使用过程中为了避免获取锁之后因为异常,致锁无法释放,所以需要在try{} catch(){}之后的finally{}结构体 阅读全文

posted @ 2017-08-08 23:35 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 单例模式 7 { 8 class Studnet 9 { 10 public string id { get; set; } 11... 阅读全文

posted @ 2017-08-08 23:14 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Collections.Concurrent; //引用命名空间 6 using System.Threading; 7 using System.Di... 阅读全文

posted @ 2017-08-08 22:13 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 6 namespace 原型模式 7 { 8 /// <summary> 9 /// 原型类 10 /// 阅读全文

posted @ 2017-08-08 00:45 清浅ヾ

摘要:一、单一职责原则 概述:一个实例对象应该只包含一种单一的职责,完成一项属于自己的任务,并完整地封装在一个类中 原因:在一个类的实例中,如果它承担的责任过重,那么他复用的机会也就越小,耦合度大大提高,当其中一个职责(方法)发生变化时,其它职责也会跟着变化,修改也就越麻烦。程序读起来也非常费劲 二、开闭 阅读全文

posted @ 2017-08-06 04:12 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Diagnostics; 6 using System.Drawing; 7 using System.Linq; 8 using System... 阅读全文

posted @ 2017-08-05 11:23 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Configuration; 4 using System.IO; 5 using System.Linq; 6 using System.Text; 7 using System.Text.RegularExpressions; ... 阅读全文

posted @ 2017-08-04 22:13 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.Configuration; 4 using System.IO; 5 using System.Linq; 6 using System.Text; 7 using System.Threading.Tasks; 8 9 namespace ... 阅读全文

posted @ 2017-08-04 21:58 清浅ヾ

摘要:1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Diagnostics; 6 using System.Drawing; 7 using System.Linq; 8 usin... 阅读全文

posted @ 2017-08-04 04:43 清浅ヾ

摘要:【服务器】 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.I 阅读全文

posted @ 2017-08-03 21:39 清浅ヾ