随笔分类 - 编程
摘要:1.fixed语句 *固定用于指针操作的变量; *可防止垃圾回收器重新定位可移动变量,并声明指向该变量的指针; *固定变量的地址,在语句的持续时间内不会更改 *fixed语句中,只能使用声明的指针,声明的指针是只读的,无法修改 *fixed语句只能在不安全的上下文中使用 static void Ma
阅读全文
摘要:xml位于命名空间中时查找 static void Main(string[] args) { XElement root = XElement.Parse(@"<aw:Root xmlns:aw='http://www.efun.com'> <aw:Child1> <aw:GrandChild1>
阅读全文
摘要:static void Main(string[] args) { XElement purchaseOrder = XElement.Load("Contacts.xml"); string partNos = (string)(from item in purchaseOrder.Descend
阅读全文
摘要:using System.Xml.Linq; static void Main(string[] args) { XElement contacts = new XElement("Contacts", new XElement("Contact", new XElement("Name", "Pa
阅读全文
摘要:1.查询一定范围数字 static void QueryInt() { // Specify the data source. int[] scores = { 97, 92, 81, 60 }; // Define the query expression. IEnumerable<int> sc
阅读全文
System.Windows.Markup.XamlParseException:““设置属性“Prism.Mvvm.ViewModelLocator.AutoWireViewModel”时引发了异常
摘要:System.Windows.Markup.XamlParseException:““设置属性“Prism.Mvvm.ViewModelLocator.AutoWireViewModel”时引发了异常。”,行号为“8”,行位置为“14”。” MissingMethodException: 没有为该对
阅读全文
摘要:1.ConcurrentDictionary ConcurrentDictionary 并发字典,保证多线程情况下的安全性 Dictionary 非线程安全集合 using System.Collections.Concurrent; class Program { static void Main
阅读全文