<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[tomstars的博客]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/tomstars</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; tomstars]]></copyright><item><title><![CDATA[加密解密（Base64、AES、MD5、HMACSHA256）]]></title><link>https://blog.csdn.net/tomstars/article/details/101679791</link><guid>https://blog.csdn.net/tomstars/article/details/101679791</guid><author>tomstars</author><pubDate>Sun, 29 Sep 2019 11:33:34 +0800</pubDate><description><![CDATA[/// &lt;summary&gt;
        /// Base64加密
        /// &lt;/summary&gt;
        /// &lt;param name="source"&gt;待加密的明文&lt;/param&gt;
        /// &lt;param name="encode"&gt;编码方式&lt;/param&gt;
        ///...]]></description><category></category></item><item><title><![CDATA[c# 关键字--类修饰符]]></title><link>https://blog.csdn.net/tomstars/article/details/95189832</link><guid>https://blog.csdn.net/tomstars/article/details/95189832</guid><author>tomstars</author><pubDate>Tue, 09 Jul 2019 13:53:46 +0800</pubDate><description><![CDATA[1 、命名空间中定义的类无法显式声明为 private、protected 或 protected internal 

2、sealed修饰类时表示当前类不可继承

3、internal修饰类时表示同一程序集下的类，可以跨类

解决方案》项目》程序集》命名空间

...]]></description><category></category></item><item><title><![CDATA[C# 静态构造方法]]></title><link>https://blog.csdn.net/tomstars/article/details/90052932</link><guid>https://blog.csdn.net/tomstars/article/details/90052932</guid><author>tomstars</author><pubDate>Fri, 10 May 2019 10:16:58 +0800</pubDate><description><![CDATA[一、编写规则

1、静态的构造方法必须无参数

2、静态构造方法中不允许出现访问修饰符

3、静态构造方法内部只能含有static变量或者static其他方法，不能使用this关键字

二、静态构造函数执行顺序

1、先子类后父类


...]]></description><category></category></item><item><title><![CDATA[C#多线程学习（九）lock，Monitor,Mutex的区别]]></title><link>https://blog.csdn.net/tomstars/article/details/89430455</link><guid>https://blog.csdn.net/tomstars/article/details/89430455</guid><author>tomstars</author><pubDate>Sun, 21 Apr 2019 11:54:16 +0800</pubDate><description><![CDATA[lock和Monitor的区别



一、lock的底层本身是Monitor来实现的，所以Monitor可以实现lock的所有功能。
二、Monitor有TryEnter的功能，可以防止出现死锁的问题，lock没有。

Mutex和其他两者的区别

一、如何控制好多个线程相互之间的联系，不产生冲突和重复，这需要用到互斥对象，即：System.Threading 命名空间中的 Mutex 类

...]]></description><category></category></item><item><title><![CDATA[Thread]]></title><link>https://blog.csdn.net/tomstars/article/details/89282686</link><guid>https://blog.csdn.net/tomstars/article/details/89282686</guid><author>tomstars</author><pubDate>Sat, 13 Apr 2019 15:27:47 +0800</pubDate><description><![CDATA[1、线程的创建


//无参委托
Thread t=new Thread(new ThreadStart(MethodName));//创建线程

Thread t=new Thread(()=&gt;{});//创建线程

//带参委托
Thread t1=new Thread(new ParameterizedThreadStart(MethodName));//创建线程
Thread t=n...]]></description><category></category></item><item><title><![CDATA[委托赋值的几种方式]]></title><link>https://blog.csdn.net/tomstars/article/details/89221344</link><guid>https://blog.csdn.net/tomstars/article/details/89221344</guid><author>tomstars</author><pubDate>Thu, 11 Apr 2019 22:09:38 +0800</pubDate><description><![CDATA[public class Test
    {
        //申明委托
        public delegate List&lt;int&gt; SelectDelegate(List&lt;int&gt; aList, int threshold);
        public List&lt;int&gt; Select(List&lt;int&gt; aList, int ...]]></description><category></category></item><item><title><![CDATA[StringBuilder的容量（StringBuilder Capacity）]]></title><link>https://blog.csdn.net/tomstars/article/details/89194580</link><guid>https://blog.csdn.net/tomstars/article/details/89194580</guid><author>tomstars</author><pubDate>Wed, 10 Apr 2019 20:58:06 +0800</pubDate><description><![CDATA[在使用StringBuilder 实例的时候，你不需要关心它为其存储的字符串分配了多大的内存，它会自动为字符串创建足够的内存。

其Capacity 属性表明了一个StringBuilder 实例最多可以存储多少个字符，当存储的字符所需的空间大于这个数的时候，StringBuilder 会自动增大内存，增加Capacity 。

而StringBuilder 实例的Length 属性则表示当前存储...]]></description><category></category></item><item><title><![CDATA[json格式字符串拼接]]></title><link>https://blog.csdn.net/tomstars/article/details/80909587</link><guid>https://blog.csdn.net/tomstars/article/details/80909587</guid><author>tomstars</author><pubDate>Wed, 30 Jan 2019 11:14:25 +0800</pubDate><description><![CDATA[首先需引入命名空间using System.IO;using Newtonsoft.Json;

StringWriter stringWriter = new StringWriter();

using (JsonTextWriter jsonWriter = new JsonTextWriter(stringWriter))
{

jsonWriter.WriteStartObject();...]]></description><category></category></item><item><title><![CDATA[采用正则表达式获取地址栏参数]]></title><link>https://blog.csdn.net/tomstars/article/details/86700434</link><guid>https://blog.csdn.net/tomstars/article/details/86700434</guid><author>tomstars</author><pubDate>Wed, 30 Jan 2019 11:08:31 +0800</pubDate><description><![CDATA[function GetQueryString(name) {
                var reg = new RegExp(&quot;(^|&amp;amp;)&quot; + name + &quot;=([^&amp;amp;]*)(&amp;amp;|$)&quot;);
                var r = window.location.search.substr(1).match(reg); //search,查询？后面的...]]></description><category></category></item><item><title><![CDATA[sqlserver 中随机取表中的数据记录]]></title><link>https://blog.csdn.net/tomstars/article/details/83653842</link><guid>https://blog.csdn.net/tomstars/article/details/83653842</guid><author>tomstars</author><pubDate>Fri, 02 Nov 2018 13:34:58 +0800</pubDate><description><![CDATA[
select top 1 * from student order by newid()

 ]]></description><category></category></item><item><title><![CDATA[相同结构的DataTable合并]]></title><link>https://blog.csdn.net/tomstars/article/details/82782515</link><guid>https://blog.csdn.net/tomstars/article/details/82782515</guid><author>tomstars</author><pubDate>Thu, 20 Sep 2018 10:32:39 +0800</pubDate><description><![CDATA[
//拷贝DataTable1的结构和数据
DataTable newDataTable = DataTable1.Copy();
//添加DataTable2的数据
 foreach (DataRow dr in DataTable2.Rows)
 {
    newDataTable.ImportRow(dr);
 }

 ]]></description><category></category></item><item><title><![CDATA[SQL server 添加、修改、删除字段]]></title><link>https://blog.csdn.net/tomstars/article/details/82014110</link><guid>https://blog.csdn.net/tomstars/article/details/82014110</guid><author>tomstars</author><pubDate>Fri, 24 Aug 2018 10:51:20 +0800</pubDate><description><![CDATA[1、添加字段

alter table 表名 add 字段名 type not null default 0

2、修改字段名

alter table 表名 rename column A to B

3、修改字段类型

alter table 表名 modify column UnitPrice decimal(18, 4) not null 

4、修改字段默认值

alter table ...]]></description><category></category></item><item><title><![CDATA[String.IsNullOrEmpty]]></title><link>https://blog.csdn.net/tomstars/article/details/81976324</link><guid>https://blog.csdn.net/tomstars/article/details/81976324</guid><author>tomstars</author><pubDate>Thu, 23 Aug 2018 10:41:57 +0800</pubDate><description><![CDATA[作用：指示指定的字符串是 null 还是 Empty 字符串。

语法：


public static bool IsNullOrEmpty(
	string value
)

参数

value

Type: System.String

要测试的字符串。

返回值

Type: System.Boolean

如果 true 参数为 value 或空字符串 (&quot;&quot;)，则为 null；否则为 ...]]></description><category></category></item><item><title><![CDATA[SQL server如何将时间段拆分为每天]]></title><link>https://blog.csdn.net/tomstars/article/details/81673936</link><guid>https://blog.csdn.net/tomstars/article/details/81673936</guid><author>tomstars</author><pubDate>Tue, 14 Aug 2018 20:33:07 +0800</pubDate><description><![CDATA[
DECLARE @days INT,@date_start DATETIME,@date_end DATETIME ;
set  @date_start= '2018-07-29';    
set  @date_end= '2018-09-01' ;
SET @days = DATEDIFF(DAY, @date_start, @date_end);  
select  DATEADD(dd,...]]></description><category></category></item><item><title><![CDATA[SQL server排序时如何将NULL排在最后面]]></title><link>https://blog.csdn.net/tomstars/article/details/81630585</link><guid>https://blog.csdn.net/tomstars/article/details/81630585</guid><author>tomstars</author><pubDate>Mon, 13 Aug 2018 15:22:31 +0800</pubDate><description><![CDATA[

下面先直接排序看下效果


select UserInfoID,User_No,User_Names 
from UserInfo 
order by User_NO asc 



可以看到指定排序的列，其值为 null 的排在了最前面。

下面就是解决办法。


select UserInfoID,User_No,User_Names 
from UserInfo 
order by ca...]]></description><category></category></item><item><title><![CDATA[C# 中GUID使用总结]]></title><link>https://blog.csdn.net/tomstars/article/details/81585809</link><guid>https://blog.csdn.net/tomstars/article/details/81585809</guid><author>tomstars</author><pubDate>Sat, 11 Aug 2018 13:18:41 +0800</pubDate><description><![CDATA[全局唯一标识符（GUID，Globally Unique Identifier）

也称作 UUID(Universally Unique IDentifier) 。

　　GUID是一种由算法生成的二进制长度为128位的数字标识符。

　　GUID主要用于在拥有多个节点、多台计算机的网络或系统中。

在理想情况下，任何计算机和计算机集群都不会生成两个相同的GUID。GUID 的总数达到了2^12...]]></description><category></category></item><item><title><![CDATA[sqlserver 各种判断是否存在（表、视图、函数、存储过程等）]]></title><link>https://blog.csdn.net/tomstars/article/details/81538626</link><guid>https://blog.csdn.net/tomstars/article/details/81538626</guid><author>tomstars</author><pubDate>Thu, 09 Aug 2018 16:17:24 +0800</pubDate><description><![CDATA[1、判断表是否存在


select * from sysobjects where id = object_id(表名) and OBJECTPROPERTY(id, N'IsUserTable') = 1

2、判断视图是否存在


select table_name from information_schema.views where table_name = 视图名

或者


SELE...]]></description><category></category></item><item><title><![CDATA[sql server 字符串函数汇总]]></title><link>https://blog.csdn.net/tomstars/article/details/81326233</link><guid>https://blog.csdn.net/tomstars/article/details/81326233</guid><author>tomstars</author><pubDate>Wed, 01 Aug 2018 10:34:54 +0800</pubDate><description><![CDATA[ 

substring（para1,para2,para3）

SQL 中的 substring 函数是用来截取一个栏位资料中的其中一部分。

para1：用于指定要操作的字符串。

para2：用于指定要截取的字符串的起始位置，起始值为 1。

para3：用于指定要截取的长度

例如，我们需要将字符串'abdcsef'中的‘abd’给提取出来，则可用substring 来实现：


sele...]]></description><category></category></item><item><title><![CDATA[SqlParameter的参数值为 null]]></title><link>https://blog.csdn.net/tomstars/article/details/81317642</link><guid>https://blog.csdn.net/tomstars/article/details/81317642</guid><author>tomstars</author><pubDate>Tue, 31 Jul 2018 17:44:44 +0800</pubDate><description><![CDATA[原因：

.Net框架规定：IDataParameter在向服务器发送 null 参数值时，用户必须指定 DBNull，而不是 null。系统中的 null 值是一个没有值的空对象。DBNull 用于表示 null 值。

 解决方法：

在给SqlParameter赋值时，如果参数值为null，将参数赋值为DBNull.Value，如：p1.Value = DBNull.Value

 

原文...]]></description><category></category></item><item><title><![CDATA[SQL server 时间函数]]></title><link>https://blog.csdn.net/tomstars/article/details/81287011</link><guid>https://blog.csdn.net/tomstars/article/details/81287011</guid><author>tomstars</author><pubDate>Mon, 30 Jul 2018 16:15:02 +0800</pubDate><description><![CDATA[DATEDIFF() 函数

定义和用法

DATEDIFF() 函数返回两个日期之间的时间。

语法


DATEDIFF(datepart,startdate,enddate)

startdate 和 enddate 参数是合法的日期表达式。

datepart 参数可以是下列的值：

atepart
			缩写
		年
			yy, yyyy
		季度
			qq, q
		月
			mm...]]></description><category></category></item></channel></rss>