上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: The .Net framework has a number of technologies that allow you to create HTTP services such as Web Service, WCF and now Web API. There are a lot of articles over the internet which may describe to whom you should use. Now a days, you have a lot of choices to build HTTP services on .NET framework. .. 阅读全文
posted @ 2013-11-28 10:29 巴别塔 阅读(3653) 评论(1) 推荐(2) 编辑
摘要: ViewModel 视图模型public abstract class ViewModelBase : INotifyPropertyChanged{ private bool isbusy; public bool IsBusy { get { return isbusy; } set { isbusy = value; RaisePropertyChanged("IsBusy"); } } public even... 阅读全文
posted @ 2013-08-29 22:49 巴别塔 阅读(530) 评论(0) 推荐(0) 编辑
摘要: void CopyDirectory(string SourcePath,string DestinationPath){ //创建所有目录 foreach(string dirPath inDirectory.GetDirectories(SourcePath,"*",SearchOption.AllDirectories)) Directory.CreateDirectory(dirPath.Replace(SourcePath,DestinationPath)); //复制所有文件 foreach(string newPath inDirectory.GetFiles 阅读全文
posted @ 2013-08-22 10:12 巴别塔 阅读(931) 评论(0) 推荐(0) 编辑
摘要: SQLLINQLambdaSELECT *FROM HumanResources.Employeefrom e in Employeesselect eEmployees .Select (e => e)SELECT e.LoginID, e.JobTitleFROM HumanResources.Employee AS efrom e in Employeesselect new {e.LoginID, e.JobTitle}Employees .Select ( e => new { LoginID = e.LoginID, JobTitle = e.JobTitle } )S 阅读全文
posted @ 2013-07-16 11:22 巴别塔 阅读(4864) 评论(1) 推荐(10) 编辑
摘要: CSLA业务规则验证规则所在空间:Csla.Rules基类BusinessBase 的属性 BusinessRules 中记录了业务类的验证规则验证规格的写法private class MyRule : Csla.Rules.BusinessRule{ protected override void Execute(RuleContext context) { var target = (Customer)context.Target; if (target.Sales 0){ string temp = string.Empty;foreach (var item in this.Basi. 阅读全文
posted @ 2013-07-11 09:40 巴别塔 阅读(534) 评论(0) 推荐(0) 编辑
摘要: 在编程过程中需要对字符串进行不同的转换,特别是Gb2312和Utf-8直接的转换。在几个开源的魔兽私服中,很多都是老外开发的,而暴雪为了能 够兼容世界上的各个字符集也使用了UTF-8。在中国使用VS(VS2005以上版本)开发基本都是使用Gb2312的Unicode字符集,所以当在编 程过程中就需要进行字符转换,这样才能兼容游戏,否则就是乱码。而在控制台显示字符串时,真好相反需要将UTF-8的字符串转换成Gb2312才能正常显 示。为了解决这个问题,本人将其代码贴出来;其实很多地方都可以使用到字符串的编码转换,代码如下://UTF-8到GB2312的转换char* U2G(const char 阅读全文
posted @ 2013-06-19 11:53 巴别塔 阅读(35444) 评论(1) 推荐(0) 编辑
摘要: 和编写一般的DLL方法相同,需要注意以下两点:(1)调用约定c函数有_stdcall、_cdecl、_fastcall等多种调用约定,调用约定用来说明函数参数的压栈顺序和由谁(函数自身还是调用者)来修改堆栈。关于调用约定的详细说明,请参考我转载的另一篇文章。编写供PB调用DLL,请使用_stdcall调用约定,如下所示:extern "c" _declspec(DLLexport) int _stdcall GetInt(char* name)(2)def文件在Vc++中,如果生成DLL可以不使用.def文件,只需要在Vc++的函数定义前加__declspec(DLLexp 阅读全文
posted @ 2013-06-18 18:17 巴别塔 阅读(1300) 评论(1) 推荐(0) 编辑
摘要: 这个在做网页中常要用到,有些通用的内容可集中放在一个页面文件中,其它要用到这些内容的页面只需要包含(引用)这个通用文件即可。这样便于维护,如果有很多网页,当通用内容需要修改时,只改一个文件就可以了,不需要每个文件单独修改。最典型的应用比如页脚的版权信息等内容可以放在一个叫做footer.html文件里, 然后其他页面文件在页面内容的最后包含这个文件就可以了,具体例子下面有。要 html文件嵌套,最简单的办法是使用SSI(Server Side Include)技术,也就是在服务器端两个文件就被合并了。除了少数免费网页寄存服务外,几乎所有的网页寄存服务器都支持 SSI。这也是一个比较推荐的方法, 阅读全文
posted @ 2013-06-07 10:00 巴别塔 阅读(5359) 评论(0) 推荐(1) 编辑
摘要: 开发中遇到一个问题SqlServer的Image类型影射为byte[]时截断了数据,变成8k,查了下NH文档,Table 5.5. Large Object Mapping Types NHibernate Type.NET TypeDatabase TypeRemarksStringClobSystem.StringDbType.Stringtype="StringClob" must be specified. Entire field is read into memory.BinaryBlobSystem.Byte[]DbType.Binarytype=" 阅读全文
posted @ 2013-05-15 14:19 巴别塔 阅读(234) 评论(0) 推荐(0) 编辑
摘要: Since the service is controlled by a GUI, the "UseSynchronizationContext" attribute was needed to solve the problem:[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall,ConcurrencyMode=ConcurrencyMode.Multiple,UseSynchronizationContext=false)]现在开发很多WCf程序已经不托管在IIS下,而是自托管了,所以在客户访 阅读全文
posted @ 2013-04-25 15:22 巴别塔 阅读(351) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页