随笔分类 - Programming---C# Programming Beginning
1
摘要:It is very useful in .net we can user framework provided role manager, and easily configure in Web.Config. However, I find when I fullfil such configu
阅读全文
摘要:Reference article: https://rkeithhill.wordpress.com/2007/09/16/effective-powershell-item-7-understanding-output/
阅读全文
摘要:Recently, I find I used many different type method to invoke other scripts or exe in PowerShell. Maybe by start new process, or just use the call oper
阅读全文
摘要:If I create a new array, and using the method Add(). Windows PowerShell will tell me : Reason: When you use the $array.Add() method, you're trying to
阅读全文
摘要:hashtable is easy to create, access and manipulate. we simply use to create an empty hash table. and use to set the key and value pair. refer to http:
阅读全文
摘要:When PS scripts executes, it is possibly create much user defined variables. So, sometimes these varibales may confuse us a lot. Here's a workaound: M
阅读全文
摘要:E.g I want match the keword "3398" after "red" from the string "This is red with number 3398". Using non-capturing group regex will help me sovle this
阅读全文
摘要:Sometimes, if we want to do convert between two enums, firstly, we may think about one way: Obviously, it's dangerous, if the int value of TheirMale i
阅读全文
摘要:When I want to pass some value that won't be seen by users, I find it useful to use this. It can help us creates a hidden input on the form for the fi
阅读全文
摘要:先来看一下默认的连接SQL Server数据库配置 SqlConnectionStringBuilder实例化时需要使用connectionString。如:SqlConnectionStringBuild builder = new SqlConnectionStringBuild(connect...
阅读全文
摘要:#Select specified items from Tuple List##Select one item to form list`tupleList.Select(element => new string(element.Item1)).ToList();`##Select one it...
阅读全文
摘要:Yield has two great usesIt helps to provide custom iteration with out creating temp collections.It helps to do stateful iterationIteration. It creates...
阅读全文
摘要:we can copy files by the powerful robocopy tool, and it allow copy using muliti-threaded as well.As Robocopy is generally a command-line only utility ...
阅读全文
摘要:In .net 4.5 Framework, we can zip a file by this way: private static string CompressFile(string sourceFileName) { using (ZipA...
阅读全文
摘要:From: http://www.cnblogs.com/wJiang/archive/2010/02/21/1670632.htmlMoq即Mock You Framework,故名思意是一个类似Mockery,JMock的Mock框架。 是google上的一个.net开源项目项目扉页相关下载ht...
阅读全文
摘要:IList, ICollection ,IEnumerable很显然,这些都是集合接口的定义,先看看定义: 1 // 摘要: 2 // 表示可按照索引单独访问的对象的非泛型集合。 3 [ComVisible(true)] 4 public interface ILis...
阅读全文
摘要:引言1.理解多线程2. 线程异步与线程同步3.创建多线程应用程序3.1通过System.Threading命名空间的类构建3.1.1异步调用线程3.1.2并发问题3.1.3线程同步3.2通过委托构建多线程应用程序3.2.1线程异步3.2.2线程同步3.3BackgroundWorker组件4.总结引...
阅读全文
摘要:readonly (C# Reference)readonly 关键字是可以在字段上使用的修饰符。 当字段声明包括 readonly 修饰符时,该声明引入的字段赋值只能作为声明的一部分出现,或者出现在同一类的构造函数中class Age { readonly int _year;...
阅读全文
摘要:异步方法容易编写string urlContents = await client.GetStringAsync(); 以下特征总结了使上面一个异步方法。方法签名包含一个 Async 或async 修饰符。异步方法的名称以“Async”后缀,按照约定,关闭。返回类型为下列类型之一:Task,如果您...
阅读全文
摘要:引用的时候需要在参数和使用的时候加上 ref 关键字 static bool addnum (ref int val) //引用 { ++val; return true; }参数数组的概念,可以接受该类型的...
阅读全文
1