04 2012 档案

摘要:跨域服务:特性WebGet在System.ServiceModel.Web中View Code [ServiceContract] public interface IDomainService { [OperationContract] [WebGet(UriTemplate = "ClientAccessPolicy.xml")] Message ProvidePolicyFile(); } public class DomainService:IDomainService { #region I... 阅读全文
posted @ 2012-04-30 16:46 Bug山Bug海 阅读(649) 评论(0) 推荐(0)
摘要:服务端类代码服务契约: [ServiceContract(CallbackContract=typeof(IserviceCallBack))] public interface IService1 { [OperationContract] string GetData(int value); } public interface IserviceCallBack { [OperationContract] string GetClientData(); }服务实例: [ServiceBeh... 阅读全文
posted @ 2012-04-30 00:36 Bug山Bug海 阅读(161) 评论(0) 推荐(0)
摘要:View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.ServiceModel;using System.ServiceModel.Channels;using System.ServiceModel.Description;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { ... 阅读全文
posted @ 2012-04-29 23:55 Bug山Bug海 阅读(310) 评论(0) 推荐(0)
摘要:此方法一般用于Web,部署环境经常变化导致IP经常变动例子是Silveright调用同域WCF服务的方法 WordGameServiceClient GetClient() { BasicHttpBinding basicbind = new BasicHttpBinding(BasicHttpSecurityMode.None); BinaryMessageEncodingBindingElement binE = new BinaryMessageEncodingBindingElement(); ... 阅读全文
posted @ 2012-04-29 13:13 Bug山Bug海 阅读(209) 评论(0) 推荐(0)
摘要:转自 http://www.cnblogs.com/nokiaguy/archive/2009/02/05/1384860.htm 先看下面一个嵌套的查询语句:select*from person.StateProvincewhere CountryRegionCodein (select CountryRegionCodefrom person.CountryRegionwhere Name like'C%') 上面的查询语句使用了一个子查询。虽然这条SQL语句并不复杂,但如果嵌套的层次过多,会使SQL语句非常难以阅读和维护。因此,也可以使用表变量的方式来解决这个问题,SQL 阅读全文
posted @ 2012-04-28 17:59 Bug山Bug海 阅读(226) 评论(0) 推荐(0)
摘要:1.事件通常写法(C# 1.0)this.button.Click +=new EventHandler(button_Click); void button_Click(object sender, EventArgs e) { throw new NotImplementedException(); } 在C#2.0中使用匿名方法this.button.Click +=delegate{throw new NotImplementedException(); }; //或者 this.button.Click +=delegate(object obj, EventArgs ar... 阅读全文
posted @ 2012-04-25 10:35 Bug山Bug海 阅读(174) 评论(0) 推荐(0)
摘要:到 C:\Program Files (or x86)\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp (or Visual Basic)\Web\MVC (or 2) 3\CodeTemplates复制CodeTemplates目录下文件到项目,删除tt类文件的Custom Tool属性,然后对项目中模板的修改会覆盖全局设置C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ItemTemplates\CSharp\Web\MVC 3\CodeTempl 阅读全文
posted @ 2012-04-16 13:00 Bug山Bug海 阅读(357) 评论(0) 推荐(0)
摘要:属性路径语法 Propertyhttp://msdn.microsoft.com/zh-cn/library/cc645024(v=vs.95).aspx#databinding_sa 阅读全文
posted @ 2012-04-10 21:34 Bug山Bug海 阅读(101) 评论(0) 推荐(0)
摘要:模拟String,让引用类型的使用像值类型一样 class MyString { private static Dictionary<string, MyString> dic = new Dictionary<string, MyString>(); string s; public MyString(string s) { this.s = s; dic[s] = this; } public static implicit operator MySt... 阅读全文
posted @ 2012-04-03 23:20 Bug山Bug海 阅读(310) 评论(0) 推荐(0)