【工作&生活】第一周

工作 这个星期也没干什么,每天都在看公司项目的代码,然后看看框架的文档。刚来公司,认识的人也不多,虽然交流的比较少,但是工作氛围还是很不错的。 生活 付费后浏览 ...

2017-07-16 · 1 分钟 · 77 字 · 碎碎念

ServiceStack.Redis 与多线程

如果是多线程的环境下使用 ServiceStack.Redis,就必须使用连接池,每次从连接池里面获取一个连接供当前线程使用,或者每次都重新实例化一个! ...

2017-06-06 · 1 分钟 · 145 字 · CSharp

Count the number of Duplicates

Count the number of Duplicates Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string.The input string can be assumed to contain only alphanumeric characters, including digits, uppercase and lowercase alphabets. Example "abcde" -> 0 # no characters repeats more than once "aabbcde" -> 2 # 'a' and 'b' "aabbcdeB" -> 2 # 'a' and 'b' "indivisibility" -> 1 # 'i' "Indivisibilities" -> 2 # 'i' and 's' "aa11" -> 2 # 'a' and '1' 解题思路 函数功能:计算字符串中重复的字符有多少个。我们只要先判断字符是否重复,然后再计算有多少个字符重复。 ...

C# Base64 加密及解密

今天准备采集一个网站,在分析他的数据的接口的时候,发现提交及返回的数据都是经过 js 加密的。然后我就开始把 js 转成 C# 的代码,运行后发现返回的数据不一样,我就在想他是不是 Base64 过的,然后就解开了… ...

2017-04-10 · 1 分钟 · 276 字 · CSharp

ASP.NET MVC 使用动态类型传递数据

问题起因 在 Controller 中定义动态类型的对象传递给视图,报错无法找到成员。 Controller: public ActionResult Index() { ViewBag.User = new { name = "何湘辉", age = 20 }; return View(); } 视图: 姓名:@ViewBag.User.name 年龄:@ViewBag.User.age 按道理来说,这样写是没问题的,但是运行后却说Model中不存在‘name’。 ...

2017-04-09 · 2 分钟 · 758 字 · CSharp