摘要: 如何水平居中,方法有2: 1. 设置当前div的style为:margin: auto; 其实真正关键的是设置其margin-left和margin-right为auto,这样的目的是自动调整div以适应屏幕宽度,使其居中 2. 设置div的父级容器,例如body样式如下: body { displ 阅读全文
posted @ 2016-04-27 15:20 Researcher 阅读(294) 评论(0) 推荐(0) 编辑
摘要: Enter-PSSession -ComputerName 139.219.135.45 -Port 5986 -Authentication Negotiate -Credential 'msstoret' -UseSSL -SessionOption (New-PSSessionOption - 阅读全文
posted @ 2016-03-02 13:42 Researcher 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 1. 确保数据保存为UTF-8格式 2. 代码中按照如下编码方式读取: StreamReader st = new System.IO.StreamReader(GetStream(url), System.Text.Encoding.UTF8); var result = st.ReadToEnd 阅读全文
posted @ 2016-03-02 13:40 Researcher 阅读(650) 评论(0) 推荐(0) 编辑
摘要: 报错: @foreach (var item in ViewBag.TopList) { if (!string.IsNullOrWhiteSpace(item.LogoPic_Mobile)) <a class="item" href="@item.ServiceLink"><img src="@ 阅读全文
posted @ 2016-02-19 11:37 Researcher 阅读(2127) 评论(0) 推荐(0) 编辑
摘要: 这两天写程序发现,多线程同时读写一个配置文件,会抛异常导致失败,看来必须加锁才行,但是这样性能又会受损失,但这是没办法的事,最后的解决方案是,把多线程产生的结果先保存在一个ConcurrentDictionary中,然后再用单线程写入配置文件,这样速度避免了对文件写操作的竞争,用单线程反而非常的快!... 阅读全文
posted @ 2015-11-30 20:34 Researcher 阅读(121) 评论(0) 推荐(0) 编辑
摘要: static string GetLotteryByPhase(string phaseNo) { // Set the url and charset string url = "http://baidu.lecai.com... 阅读全文
posted @ 2015-11-29 17:26 Researcher 阅读(210) 评论(0) 推荐(0) 编辑
摘要: List taskList = new List(); // string currentNoStr = null; cannot define at here, we should define the copy in for loop, this i... 阅读全文
posted @ 2015-11-29 17:12 Researcher 阅读(127) 评论(0) 推荐(0) 编辑
摘要: // Sort dictionary by the value field List> redBallsList = redBallsDict.ToList(); List> blueBallsList = blueBallsDic... 阅读全文
posted @ 2015-11-29 16:56 Researcher 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 下面是如何最大化console和改变其显示的字体颜色的代码,顺便包含了计时代码(帮助做性能分析): class Program { [DllImport("kernel32.dll", ExactSpelling = true)] private static... 阅读全文
posted @ 2015-11-29 16:50 Researcher 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Same:delete/truncate/drop, all of them can support rollback/commit, the sample is as below:begin tran T1truncate table TestTablerollback/commitDiffere... 阅读全文
posted @ 2015-11-25 13:52 Researcher 阅读(137) 评论(0) 推荐(0) 编辑