posts - 241,  comments - 116,  trackbacks - 0
问:C#怎么设定Stream.Read的超时时间
答:streamReader.BaseStream.ReadTimeout = 2000;

问:C#如何从XmlNode里删除CDATA标签
答:
xml.innerText = xml.innerText.Replace("![CDATA[","").Replace("]]","");
xmlDoc.Save();// xmlDoc is your xml document

答:
var dt = new DateTime(1970, 1, 1, 0, 0, 0, 0).AddSeconds(Math.Round(1372061224000 / 1000d)).ToLocalTime();
Console.WriteLine(dt); // Prints: 6/24/2013 10:07:04 AM

问:C#怎么获得XSD schema主属性的值
答:
var attributes = (from n in xml.Root.Attributes("someProperty")
                        select n.Value).ToList();
问:C#怎么判断一个字符串是否包含多个连续空格
答:
Regex regex = new Regex(@"\s{2,}"); // matches at least 2 whitespaces
if (regex.IsMatch(inputString))
    // do something

posted on 2013-08-12 10:53 墙头草 阅读(2403) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 
人人游戏网 软件开发网 货运专家