解决方法
看看
the source code for WP7DataCollector.GetAppAttribute()在
Microsoft Silverlight Analytics Framework. GetAppAttribute(“标题”)会做到这一点.
/// <summary> /// Gets an attribute from the Windows Phone App Manifest App element /// </summary> /// <param name="attributeName">the attribute name</param> /// <returns>the attribute value</returns> private static string GetAppAttribute(string attributeName) { string appManifestName = "WMAppManifest.xml"; string appNodeName = "App"; var settings = new XmlReaderSettings(); settings.XmlResolver = new XmlXapResolver(); using (XmlReader rdr = XmlReader.Create(appManifestName,settings)) { rdr.ReadToDescendant(appNodeName); if (!rdr.IsstartElement()) { throw new System.FormatException(appManifestName + " is missing " + appNodeName); } return rdr.GetAttribute(attributeName); } }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。