代码改变世界

阅读排行榜

调用webservice 417

2013-10-07 16:53 by Carl Xing, 398 阅读, 收藏,
摘要: 在调用webservice时有些服务器一直返回“远程服务器返回错误: (417)Expectation failed”这个提示,解决方案:在调用代码的最开始加入如下一句:System.Net.ServicePointManager.Expect100Continue = false;或在配置文件中加入(示例代码中的粗体文字):这个异常源自HTTP1.1协议的一个规范: 100(Continue)100(Continue)状态代码的解释允许客户端发request消息body之前先用request header试探一下server,看server要不要接收request body,再决定要不要发r 阅读全文

Forms身份验证

2013-03-07 17:08 by Carl Xing, 398 阅读, 收藏,
摘要: Form身份验证需引入命名空间System.Web.Security。配置web.config,在system.web节点下加上 也可在节点上添加账户: ... 阅读全文

Attribute

2011-08-26 09:45 by Carl Xing, 396 阅读, 收藏,
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ReflectionClass{ public enum Fruit { Apple, Banana, Pear, Watermelon } public class FruitTypeAttribute:System.Attribute { public FruitTypeAttribute(Fruit frui... 阅读全文

Socket

2012-07-10 16:55 by Carl Xing, 364 阅读, 收藏,
摘要: 1、基于TCP的web服务器 windows控制台应用程序class Program { static void Main(string[] args) { //SocketServer(); GetClientMsg(... 阅读全文

CollectionBase的使用

2011-08-05 18:57 by Carl Xing, 348 阅读, 收藏,
摘要: interface IItem { object name { get; set; } object value { get; set; } void getItemByName(); } public class ItemClass : IItem { #region IItem 成员 public object name { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public object value { get { throw new Not. 阅读全文