- 博客(221)
- 资源 (14)
- 收藏
- 关注
原创 记录用到的正规,验证中文、英文、数字、下划线
/// /// 计算字符数(中文占两位) /// /// /// static int CalStringLength(string str) { return System.Text.Encoding.Default.GetByteCount(str);
2015-10-20 09:29:01 1505
原创 chrome没有注册类解决
Win+R 输入 regedit.exe 找到[HKEY_CLASSES_ROOT\Chrome]删除找到[HKEY_CLASSES_ROOT\Chrome.******]删除保留[HKEY_CLASSES_ROOT\ChromeHTML]找到[HKEY_CLASSES_ROOT\ChromeHTML.****]删除[HKEY_CLASSES_RO
2015-05-28 13:03:18 3198
原创 C#dll版本号默认生成规则
1.版本号自动生成方法只需把 AssemblyInfo.cs文件中的[assembly:AssemblyVersion("1.0.0.0")]改成[assembly:AssemblyVersion("1.0.*")],另外还需要把[assembly:AssemblyFileVersion("1.0.0.0")]注释屏蔽掉。这样再生成的程序集就是自动版本号了。2.按照这个
2015-04-20 16:03:27 5449
原创 DataTable去掉重复行
private DataTable DistinctRow(DataTable table) { DataTable newTable = table.Clone(); var group = from r in table.AsEnumerable() group r by new {
2015-04-15 14:33:40 833
原创 Oracle 生成批量删除现有表
select 'drop table '||table_name||' purge;' from user_tables where table_name like 'AAA%'注意 table_name like 'AAA%' 表名必须是大写
2015-04-14 16:32:51 741
原创 C# Oracle同时执行多条sql语句
最近经常要在程序中创建不同的表create table TableName ( Id NUMBER not null, Age NUMBER not null, Name NVARCHAR2(50) );comment on co
2015-04-01 14:46:18 7880
原创 C#读取已经被占用的文件
FileStream file = new FileStream("test.xlsx", FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
2015-03-16 16:34:31 2569
原创 Oracle Update select
update table1 set t1.NoFee=(select decode(sign((t1.N+:N)-t2.b),1,t2.b,N+:N) from table2 t2 where t2.c=:c) ,Updatetime=:UpdateTime where t1.c=:c
2015-03-16 10:07:16 597
原创 js for in
Document var obj={"MBBindingType":1,"Superscript":"注册送3元","TxtRegisterButton":"立即注册","TxtLoginButton":"立即登录","DescModels":[{"PropertieName":"MBBindingType","PropertieDesc":"手机验证类型"},{"PropertieNa
2015-03-11 22:21:35 432
转载 sublime C#注释配置
C#中的注释快捷键是无效的,这是因为 Packages文件夹 中缺少了定义注释行为的文件。打开Packages,在C#文件夹中添加一个名为: Comments.tmPreferences 文件,输入如下内容: name Comments scope source.cs settings s
2015-02-05 08:40:33 993
转载 .NET开发者必备的工具箱
主要工具Visual Studio——IDEs工具之王,.NET开发者的必备IDE。Visual Studio提供非常强大的启动工具箱,并且还有一些让人惊喜的插件支持。在去年11月,微软发布了Visual Studio 2013社区版,免费提供给学生、开源贡献者及初创企业使用。每一次版本更新都会给开发者带来无限惊喜。SQL Server Management Studio——S
2015-01-30 09:05:35 630 1
原创 Sublime text2使用
添加右键菜单1.打开注册表,开始→运行→regedit2.在 HKEY_CLASSSES_ROOT→ * → Shell 下面新建项命名为 Edit with Sublime Text3.在新建字符串值 命名为Icon,值为 “Sublime text 所在路径,0″,我这里就是D:\Program Files (x86)\Sublime Text 2\sublime_text.exe
2015-01-11 10:05:54 646
原创 创建刷新物化视图存储过程
CREATE PROCEDURE REFRESH_MV(viewName in varchar2)ASBEGIN sys.DBMS_SNAPSHOT.refresh(viewName);END;
2015-01-09 13:33:20 1338
原创 求某年有多少周
/// /// 求某年有多少周 /// 返回 int /// /// /// int 周数 public static int GetYearWeekCount(DateTime year) { string returnStr = "";
2014-12-10 14:13:35 560
原创 socket通信简单示例
服务端:static void Main(string[] args) { Start(); } static void Start() { string hostIp = ConfigurationManager.AppSettings["Hos
2014-11-25 15:40:34 652
转载 Sublime快捷键
ctrl+shift+n 打开新Sublimectrl+shift+w 关闭Sublime,关闭所有打开文件ctrl+shift+t 重新打开最近关闭文件ctrl+n 新建文件ctrl+s 保存ctrl+shift+s 另存为ctrl+f4 关闭文件ctrl+w 关闭ctrl+k, ctrl+b 切换侧边栏显示状态f11 切换全屏状态shift+f11 免打
2014-11-24 08:57:35 550
原创 MVC4 Controller和Action生成模板所在文件夹
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 4\CodeTemplates
2014-08-18 16:20:40 1858
原创 Linq to DB 解决方案ALinq
Linq to SQL 是不支持除了 SQL Server 和 SQL CE 之外的数据库,如果你需要的是 Linq to DB 解决方案,可以使用ALinq
2014-06-27 09:31:56 1173
原创 C#反射获取私有字段
using System;using System.Collections.Generic;using System.Text;using System.Reflection;namespace ReflectionDemo{ class Program { static void Main(string[] args) {
2014-06-26 13:35:27 12371 2
原创 C#不重启程序读取appconfig
using System;using System.Collections.Generic;using System.Configuration;using System.Linq;using System.Text;namespace Demo{ class Program { static void Main(string[] args)
2014-06-13 16:12:50 1550
原创 判断是不是C#内置类型
private static bool IsBulitinType(Type type){ return (type == typeof(object) || Type.GetTypeCode(type) != TypeCode.Object);}
2014-05-22 11:33:12 4009
原创 引用webservice 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。
binding="customBinding" bindingConfiguration="AlarmMonitorEventSoap12" contract="Service.AlarmMonitorEventSoap" name="AlarmMonitorEventSoap12" />
2014-05-09 17:13:47 5702
原创 VS2008下载地址
http://download.microsoft.com/download/d/8/9/d89c9839-ac45-4a6c-b25f-2f60b190e356/VS2008TeamSuiteENU90DayTrialX1429235.iso
2014-05-03 15:34:17 982
原创 MVC return View(string viewName) 中viewName的表达方式
首先在Views中创建一个文件夹Other,再创建一个Index.cshtml在HomeController 中的Index Action 中的return View可以如下return View("../Other/Index");return View("/Views/Other/Index.cshtml");
2014-04-01 17:19:24 14207 1
原创 看到一篇很好的文章
public override IHttpHandler GetHandler ( HttpContext context, string requestType, string virtualPath, string path){ Page page = base.GetHandler (context, requestType, virtualPath, path)
2014-03-23 09:46:58 802
原创 T4 同解决方案下分别读写不同项目下的AppConfig和WebConfig
首先为了能读写webconfig,需要引用System.Web.Configuration;当然读取appconfig 需要有System.Configuration;<#+private void WriteWebConfig(string webProjectName){ string appPath = Path.Combine(Host.ResolveAs
2014-03-12 14:00:27 2660
原创 AppConsole中把当前的App.config连接字符串写入到同解决方案下的Web项目下的webcofig
首先为了能读写webconfig,需要引用System.Web.Configuration;当然读取appconfig 需要有System.Configuration;class Program { static void Main(string[] args) { string s=System.Configuration
2014-03-12 10:50:27 1432
原创 Linq查询出现"此上下文仅支持基元类型或枚举类型。"解决方法
今天用Linq查询的时候,出现“此上下文仅支持基元类型或枚举类型。”var query = from user in userService.Entities join role in roles on user.ID equals role.USER_ID select new {user};提示的是role的当中还
2014-03-11 10:20:13 14323 1
原创 EF中"实体类型 XXXXX 不是当前上下文的模型的一部分。" 解决方法
我的实体是用T4自己生成的,过滤一了些模型属性,当返回数据时出现"实体类型 XXXXX 不是当前上下文的模型的一部分。" 后来和模型视图比对,发现少了关联字段,添加上后正常如果比对不出来,可用原来的tt生成的实体进行比对
2014-03-10 17:11:31 26034
原创 T4模板生成文件后加入到解决方案
这是老外的文章,大家可以参考下http://shengjieinsight.com/blog/2013/12/use-envdte-addremove-multiple-files-to-project/
2014-03-07 16:55:19 3447
原创 T4模板中获取当前项目或解决方案路径
<# string solutionsPath = Host.ResolveAssemblyReference("$(SolutionDir)"); string projectPath = Host.ResolveAssemblyReference("$(ProjectDir)");#>
2014-03-04 11:01:18 5667
原创 Unity调用方法注入
接口using System;using System.Collections.Generic;using System.Linq;using System.Security.Cryptography.X509Certificates;using System.Text;namespace UnityDemo3{ public interface ISqlMapper
2014-02-11 17:37:15 2975
转载 用Unity注入webservice
看到老外的一个用Unity依赖注入webservice的文章思路清晰地址如下http://www.codeproject.com/Articles/310677/ASP-NET-Web-Services-Dependency-Injection-using-Un
2014-02-11 10:21:56 2139
原创 Webservice接收16进制字符串并保存相应的文件
今天ipad那面想做下webservice上传图片,我这面要做个测试的接口,用于测试图片是以16进制的字符串传过来,并同时传进来文件名称,因为只是测试所以,最简单的写了一个[WebMethod] public void UploadFile(string fs,string fileName) { byte[] bas
2014-01-16 13:44:50 1195
原创 Webservice中Global.asax文件的Application_Start不能触发
Webservice中Global.asax文件的Application_Start不能触发后来发现是用的本地的iis,所以Application_Start不能触发,但是在vs自带的IISExpress却可以Application_BeginRequest在IIS下和IISExpress都可以触发
2013-12-25 15:39:00 8077
Pro Spring 5, 5th Edition
2017-10-18
Bootstrap for ASP.NET MVC, 2nd Edition
2017-09-25
ASP.NET Core Recipes, 2nd Edition
2017-09-25
Docker Management Design Patterns
2017-09-25
Beginning ASP.NET MVC 4
2013-09-20
ASP.NET MVC 4 in Action
2013-09-20
Pro ASP.NET MVC 4, 4th edition
2013-09-20
spring.net中文手册在线版
2012-11-28
sqlserver2005基础教程英文版
2012-10-16
SQL Server2005基础教程
2012-07-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人