大约有 11,000 项符合查询结果(耗时:0.0106秒) [XML]
无法将类型“System.Collections.Generic.List<string>”隐式转换为...
List<string> list = new List<string>();
.........
ArrayList al = new ArrayList();
al.AddRange(list);复制代码如果单纯转换为对象数组,直接调用 list.ToArray() 方法。
无法将方法组“Values”转换为非委托类型“System.Collections.Generic.Lis...
出现此类编译错误,极有可能是把函数当成属性用了。
错误:xxx.Values;
正确:xxx.Values();
反之如果把属性当函数用则报编译错误:
这个低级错误有时还真容易犯{:wabi:}沧海一粟 发表于 2015-11-30 16:24
这个低级错误有时还真...
WCF中可以实现泛型接口的服务契约吗? - 其他 - 清泛IT社区,为创新赋能!
有人建议给interface加上KnownType
[DataContract]
[KnownType(typeof(Xxx))]
public class Response
{ ... }
貌似也不行。。。
C# TextWriterTraceListener便捷写文件、快速记录日志 - .NET(C#) - 清泛IT...
TextWriterTraceListener traceLsr = new TextWriterTraceListener(@"C:\log.txt");
traceLsr.WriteLine("first line.");
traceLsr.Flush(); // 将Stream写入文件复制代码TextWriterTraceListener 命名空间:using System.Diagnostics;
在文件末尾累加写入内容。
Linq 多字段排序,二次排序 - .NET(C#) - 清泛IT论坛,有思想、有深度
Linq:ordered = source.OrderByDescending( t => t.f1 ).ThenBy( t => t.f2 );
类似SQL:select * from t1 order by f1 desc ,f2 asc
这种写法里 OrderBy、ThenBy 是升序的,OrderByDescending、ThenByDescending 是降序的。
无法将类型“System.Collections.Generic.List<xxxx.Test>”隐式转换...
WCF接口是List型,但客户端需要传入Array型,若传入List型参数,则报错:
无法将类型“System.Collections.Generic.List<MyTestClient.WcfApp.CommonManageSrv.Test>”隐式转换为“MyTestClient.WcfApp.CommonManageSrv.Test[]”。
原因是WCF默认把List类型...
XmlNode与XmlElement的区别总结 - .NET(C#) - 清泛IT社区,为创新赋能!
转自CSDN:http://bbs.csdn.net/topics/330203920
今天在做ASP.NET操作XML文档的过程中,发现了两个类:XmlNode和XmlElement。这两个类的功能极其类似(因为我们一般都是在对Element节点进行操作)。上网搜罗了半天,千篇一律的答案。永远说...
BinaryFormatter SoapFormatter XmlSerializer命名空间 - .NET(C#) - 清泛IT社区,为创新赋能!
BinaryFormatter:
using System.Runtime.Serialization.Formatters.Binary;
SoapFormatter:
添加引用
using System.Runtime.Serialization.Formatters.Soap;
XmlSerializer:
using System.Xml.Serialization;
Maximum number of items that can be serialized or deserialized in an o...
报错消息:
Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota.
修改如下相应的WCF配置,即可解决。
服务器端:
<system.serviceModel>
<beh...
C# HashCode及Equals - .NET(C#) - 清泛IT论坛,有思想、有深度
同一Domain下:
Equals为true则HashCode一定相等;
HashCode相等则Equals不一定为true;
Equals为false也可能HashCode相等(这种情况称之为Hash碰撞)。