WPF 读取Docx文件并显示(附下载链接)

在wpf中直接显示Docx文件 ,直接看看效果吧:

下面直接看代码,添加主要有两个类:

DocxReader类:

using System;
using System.IO;
using System.IO.Packaging;
using System.Xml;namespace WpfEmbeddedDocx
{class DocxReader : IDisposable{protected const stringMainDocumentRelationshipType ="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",// XML namespacesWordprocessingMLNamespace = "http://schemas.openxmlformats.org/wordprocessingml/2006/main",RelationshipsNamespace = "http://schemas.openxmlformats.org/officeDocument/2006/relationships",// Miscellaneous elementsDocumentElement = "document",BodyElement = "body",// Block-Level elementsParagraphElement = "p",TableElement = "tbl",// Inline-Level elementsSimpleFieldElement = "fldSimple",HyperlinkElement = "hyperlink",RunElement = "r",// Run content elementsBreakElement = "br",TabCharacterElement = "tab",TextElement = "t",// Table elementsTableRowElement = "tr",TableCellElement = "tc",// Properties elementsParagraphPropertiesElement = "pPr",RunPropertiesElement = "rPr";// Note: new members should also be added to nameTable in CreateNameTable method.protected virtual XmlNameTable CreateNameTable(){var nameTable = new NameTable();nameTable.Add(WordprocessingMLNamespace);nameTable.Add(RelationshipsNamespace);nameTable.Add(DocumentElement);nameTable.Add(BodyElement);nameTable.Add(ParagraphElement);nameTable.Add(TableElement);nameTable.Add(ParagraphPropertiesElement);nameTable.Add(SimpleFieldElement);nameTable.Add(HyperlinkElement);nameTable.Add(RunElement);nameTable.Add(BreakElement);nameTable.Add(TabCharacterElement);nameTable.Add(TextElement);nameTable.Add(RunPropertiesElement);nameTable.Add(TableRowElement);nameTable.Add(TableCellElement);return nameTable;}private readonly Package package;private readonly PackagePart mainDocumentPart;protected PackagePart MainDocumentPart{get { return this.mainDocumentPart; }}public DocxReader(Stream stream){if (stream == null)throw new ArgumentNullException("stream");this.package = Package.Open(stream, FileMode.Open, FileAccess.Read);foreach (var relationship in this.package.GetRelationshipsByType(MainDocumentRelationshipType)){this.mainDocumentPart = package.GetPart(PackUriHelper.CreatePartUri(relationship.TargetUri));break;}}public void Read(){using (var mainDocumentStream = this.mainDocumentPart.GetStream(FileMode.Open, FileAccess.Read))using (var reader = XmlReader.Create(mainDocumentStream, new XmlReaderSettings(){NameTable = this.CreateNameTable(),IgnoreComments = true,IgnoreProcessingInstructions = true,IgnoreWhitespace = true}))this.ReadMainDocument(reader);}private static void ReadXmlSubtree(XmlReader reader, Action<XmlReader> action){using (var subtreeReader = reader.ReadSubtree()){// Position on the first node.subtreeReader.Read();if (action != null)action(subtreeReader);}}private void ReadMainDocument(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == DocumentElement){ReadXmlSubtree(reader, this.ReadDocument);break;}}protected virtual void ReadDocument(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == BodyElement){ReadXmlSubtree(reader, this.ReadBody);break;}}private void ReadBody(XmlReader reader){while (reader.Read())this.ReadBlockLevelElement(reader);}private void ReadBlockLevelElement(XmlReader reader){if (reader.NodeType == XmlNodeType.Element){Action<XmlReader> action = null;if (reader.NamespaceURI == WordprocessingMLNamespace)switch (reader.LocalName){case ParagraphElement:action = this.ReadParagraph;break;case TableElement:action = this.ReadTable;break;}ReadXmlSubtree(reader, action);}}protected virtual void ReadParagraph(XmlReader reader){while (reader.Read()){if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == ParagraphPropertiesElement)ReadXmlSubtree(reader, this.ReadParagraphProperties);elsethis.ReadInlineLevelElement(reader);}}protected virtual void ReadParagraphProperties(XmlReader reader){}private void ReadInlineLevelElement(XmlReader reader){if (reader.NodeType == XmlNodeType.Element){Action<XmlReader> action = null;if (reader.NamespaceURI == WordprocessingMLNamespace)switch (reader.LocalName){case SimpleFieldElement:action = this.ReadSimpleField;break;case HyperlinkElement:action = this.ReadHyperlink;break;case RunElement:action = this.ReadRun;break;}ReadXmlSubtree(reader, action);}}private void ReadSimpleField(XmlReader reader){while (reader.Read())this.ReadInlineLevelElement(reader);}protected virtual void ReadHyperlink(XmlReader reader){while (reader.Read())this.ReadInlineLevelElement(reader);}protected virtual void ReadRun(XmlReader reader){while (reader.Read()){if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == RunPropertiesElement)ReadXmlSubtree(reader, this.ReadRunProperties);elsethis.ReadRunContentElement(reader);}}protected virtual void ReadRunProperties(XmlReader reader){}private void ReadRunContentElement(XmlReader reader){if (reader.NodeType == XmlNodeType.Element){Action<XmlReader> action = null;if (reader.NamespaceURI == WordprocessingMLNamespace)switch (reader.LocalName){case BreakElement:action = this.ReadBreak;break;case TabCharacterElement:action = this.ReadTabCharacter;break;case TextElement:action = this.ReadText;break;}ReadXmlSubtree(reader, action);}}protected virtual void ReadBreak(XmlReader reader){}protected virtual void ReadTabCharacter(XmlReader reader){}protected virtual void ReadText(XmlReader reader){}protected virtual void ReadTable(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == TableRowElement)ReadXmlSubtree(reader, this.ReadTableRow);}protected virtual void ReadTableRow(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace &&reader.LocalName == TableCellElement)ReadXmlSubtree(reader, this.ReadTableCell);}protected virtual void ReadTableCell(XmlReader reader){while (reader.Read())this.ReadBlockLevelElement(reader);}public void Dispose(){this.package.Close();}}
}

DocxToFlowDocumentConverter类:

using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Packaging;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Navigation;
using System.Xml;namespace WpfEmbeddedDocx
{class DocxToFlowDocumentConverter : DocxReader{private const string// Run properties elementsBoldElement = "b",ItalicElement = "i",UnderlineElement = "u",StrikeElement = "strike",DoubleStrikeElement = "dstrike",VerticalAlignmentElement = "vertAlign",ColorElement = "color",HighlightElement = "highlight",FontElement = "rFonts",FontSizeElement = "sz",RightToLeftTextElement = "rtl",// Paragraph properties elementsAlignmentElement = "jc",PageBreakBeforeElement = "pageBreakBefore",SpacingElement = "spacing",IndentationElement = "ind",ShadingElement = "shd",// AttributesIdAttribute = "id",ValueAttribute = "val",ColorAttribute = "color",AsciiFontFamily = "ascii",SpacingAfterAttribute = "after",SpacingBeforeAttribute = "before",LeftIndentationAttribute = "left",RightIndentationAttribute = "right",HangingIndentationAttribute = "hanging",FirstLineIndentationAttribute = "firstLine",FillAttribute = "fill";private FlowDocument document;private TextElement current;private bool hasAnyHyperlink;public FlowDocument Document{get { return this.document; }}public DocxToFlowDocumentConverter(Stream stream): base(stream){}protected override XmlNameTable CreateNameTable(){var nameTable = base.CreateNameTable();nameTable.Add(BoldElement);nameTable.Add(ItalicElement);nameTable.Add(UnderlineElement);nameTable.Add(StrikeElement);nameTable.Add(DoubleStrikeElement);nameTable.Add(VerticalAlignmentElement);nameTable.Add(ColorElement);nameTable.Add(HighlightElement);nameTable.Add(FontElement);nameTable.Add(FontSizeElement);nameTable.Add(RightToLeftTextElement);nameTable.Add(AlignmentElement);nameTable.Add(PageBreakBeforeElement);nameTable.Add(SpacingElement);nameTable.Add(IndentationElement);nameTable.Add(ShadingElement);nameTable.Add(IdAttribute);nameTable.Add(ValueAttribute);nameTable.Add(ColorAttribute);nameTable.Add(AsciiFontFamily);nameTable.Add(SpacingAfterAttribute);nameTable.Add(SpacingBeforeAttribute);nameTable.Add(LeftIndentationAttribute);nameTable.Add(RightIndentationAttribute);nameTable.Add(HangingIndentationAttribute);nameTable.Add(FirstLineIndentationAttribute);nameTable.Add(FillAttribute);return nameTable;}protected override void ReadDocument(XmlReader reader){this.document = new FlowDocument();this.document.BeginInit();this.document.ColumnWidth = double.NaN;base.ReadDocument(reader);if (this.hasAnyHyperlink)this.document.AddHandler(Hyperlink.RequestNavigateEvent,new RequestNavigateEventHandler((sender, e) => Process.Start(e.Uri.ToString())));this.document.EndInit();}protected override void ReadParagraph(XmlReader reader){using (this.SetCurrent(new Paragraph()))base.ReadParagraph(reader);}protected override void ReadTable(XmlReader reader){// Skip table for now.}protected override void ReadParagraphProperties(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace){var paragraph = (Paragraph)this.current;switch (reader.LocalName){case AlignmentElement:var textAlignment = ConvertTextAlignment(GetValueAttribute(reader));if (textAlignment.HasValue)paragraph.TextAlignment = textAlignment.Value;break;case PageBreakBeforeElement:paragraph.BreakPageBefore = GetOnOffValueAttribute(reader);break;case SpacingElement:paragraph.Margin = GetSpacing(reader, paragraph.Margin);break;case IndentationElement:SetParagraphIndent(reader, paragraph);break;case ShadingElement:var background = GetShading(reader);if (background != null)paragraph.Background = background;break;}}}protected override void ReadHyperlink(XmlReader reader){var id = reader[IdAttribute, RelationshipsNamespace];if (!string.IsNullOrEmpty(id)){var relationship = this.MainDocumentPart.GetRelationship(id);if (relationship.TargetMode == TargetMode.External){this.hasAnyHyperlink = true;var hyperlink = new Hyperlink(){NavigateUri = relationship.TargetUri};using (this.SetCurrent(hyperlink))base.ReadHyperlink(reader);return;}}base.ReadHyperlink(reader);}protected override void ReadRun(XmlReader reader){using (this.SetCurrent(new Span()))base.ReadRun(reader);}protected override void ReadRunProperties(XmlReader reader){while (reader.Read())if (reader.NodeType == XmlNodeType.Element && reader.NamespaceURI == WordprocessingMLNamespace){var inline = (Inline)this.current;switch (reader.LocalName){case BoldElement:inline.FontWeight = GetOnOffValueAttribute(reader) ? FontWeights.Bold : FontWeights.Normal;break;case ItalicElement:inline.FontStyle = GetOnOffValueAttribute(reader) ? FontStyles.Italic : FontStyles.Normal;break;case UnderlineElement:var underlineTextDecorations = GetUnderlineTextDecorations(reader, inline);if (underlineTextDecorations != null)inline.TextDecorations.Add(underlineTextDecorations);break;case StrikeElement:if (GetOnOffValueAttribute(reader))inline.TextDecorations.Add(TextDecorations.Strikethrough);break;case DoubleStrikeElement:if (GetOnOffValueAttribute(reader)){inline.TextDecorations.Add(new TextDecoration(){Location = TextDecorationLocation.Strikethrough,PenOffset = this.current.FontSize * 0.015});inline.TextDecorations.Add(new TextDecoration(){Location = TextDecorationLocation.Strikethrough,PenOffset = this.current.FontSize * -0.015});}break;case VerticalAlignmentElement:var baselineAlignment = GetBaselineAlignment(GetValueAttribute(reader));if (baselineAlignment.HasValue){inline.BaselineAlignment = baselineAlignment.Value;if (baselineAlignment.Value == BaselineAlignment.Subscript ||baselineAlignment.Value == BaselineAlignment.Superscript)inline.FontSize *=0.65; //MS Word 2002 size: 65% http://en.wikipedia.org/wiki/Subscript_and_superscript}break;case ColorElement:var color = GetColor(GetValueAttribute(reader));if (color.HasValue)inline.Foreground = new SolidColorBrush(color.Value);break;case HighlightElement:var highlight = GetHighlightColor(GetValueAttribute(reader));if (highlight.HasValue)inline.Background = new SolidColorBrush(highlight.Value);break;case FontElement:var fontFamily = reader[AsciiFontFamily, WordprocessingMLNamespace];if (!string.IsNullOrEmpty(fontFamily))inline.FontFamily =(FontFamily)new FontFamilyConverter().ConvertFromString(fontFamily);break;case FontSizeElement:var fontSize = reader[ValueAttribute, WordprocessingMLNamespace];if (!string.IsNullOrEmpty(fontSize))// Attribute Value / 2 = Points// Points * (96 / 72) = Pixelsinline.FontSize = uint.Parse(fontSize) * 0.6666666666666667;break;case RightToLeftTextElement:inline.FlowDirection = (GetOnOffValueAttribute(reader))? FlowDirection.RightToLeft: FlowDirection.LeftToRight;break;}}}protected override void ReadBreak(XmlReader reader){this.AddChild(new LineBreak());}protected override void ReadTabCharacter(XmlReader reader){this.AddChild(new Run("\t"));}protected override void ReadText(XmlReader reader){this.AddChild(new Run(reader.ReadString()));}private void AddChild(TextElement textElement){((IAddChild)this.current ?? this.document).AddChild(textElement);}private static bool GetOnOffValueAttribute(XmlReader reader){var value = GetValueAttribute(reader);switch (value){case null:case "1":case "on":case "true":return true;default:return false;}}private static string GetValueAttribute(XmlReader reader){return reader[ValueAttribute, WordprocessingMLNamespace];}private static Color? GetColor(string colorString){if (string.IsNullOrEmpty(colorString) || colorString == "auto")return null;return (Color)ColorConverter.ConvertFromString('#' + colorString);}private static Color? GetHighlightColor(string highlightString){if (string.IsNullOrEmpty(highlightString) || highlightString == "auto")return null;return (Color)ColorConverter.ConvertFromString(highlightString);}private static BaselineAlignment? GetBaselineAlignment(string verticalAlignmentString){switch (verticalAlignmentString){case "baseline":return BaselineAlignment.Baseline;case "subscript":return BaselineAlignment.Subscript;case "superscript":return BaselineAlignment.Superscript;default:return null;}}private static double? ConvertTwipsToPixels(string twips){if (string.IsNullOrEmpty(twips))return null;elsereturn ConvertTwipsToPixels(double.Parse(twips, CultureInfo.InvariantCulture));}private static double ConvertTwipsToPixels(double twips){return 96d / (72 * 20) * twips;}private static TextAlignment? ConvertTextAlignment(string value){switch (value){case "both":return TextAlignment.Justify;case "left":return TextAlignment.Left;case "right":return TextAlignment.Right;case "center":return TextAlignment.Center;default:return null;}}private static Thickness GetSpacing(XmlReader reader, Thickness margin){var after = ConvertTwipsToPixels(reader[SpacingAfterAttribute, WordprocessingMLNamespace]);if (after.HasValue)margin.Bottom = after.Value;var before = ConvertTwipsToPixels(reader[SpacingBeforeAttribute, WordprocessingMLNamespace]);if (before.HasValue)margin.Top = before.Value;return margin;}private static void SetParagraphIndent(XmlReader reader, Paragraph paragraph){var margin = paragraph.Margin;var left = ConvertTwipsToPixels(reader[LeftIndentationAttribute, WordprocessingMLNamespace]);if (left.HasValue)margin.Left = left.Value;var right = ConvertTwipsToPixels(reader[RightIndentationAttribute, WordprocessingMLNamespace]);if (right.HasValue)margin.Right = right.Value;paragraph.Margin = margin;var firstLine = ConvertTwipsToPixels(reader[FirstLineIndentationAttribute, WordprocessingMLNamespace]);if (firstLine.HasValue)paragraph.TextIndent = firstLine.Value;var hanging = ConvertTwipsToPixels(reader[HangingIndentationAttribute, WordprocessingMLNamespace]);if (hanging.HasValue)paragraph.TextIndent -= hanging.Value;}private static Brush GetShading(XmlReader reader){var color = GetColor(reader[FillAttribute, WordprocessingMLNamespace]);return color.HasValue ? new SolidColorBrush(color.Value) : null;}private static TextDecorationCollection GetUnderlineTextDecorations(XmlReader reader, Inline inline){TextDecoration textDecoration;Brush brush;var color = GetColor(reader[ColorAttribute, WordprocessingMLNamespace]);if (color.HasValue)brush = new SolidColorBrush(color.Value);elsebrush = inline.Foreground;var textDecorations = new TextDecorationCollection(){(textDecoration = new TextDecoration(){Location = TextDecorationLocation.Underline,Pen = new Pen(){Brush = brush}})};switch (GetValueAttribute(reader)){case "single":break;case "double":textDecoration.PenOffset = inline.FontSize * 0.05;textDecoration = textDecoration.Clone();textDecoration.PenOffset = inline.FontSize * -0.05;textDecorations.Add(textDecoration);break;case "dotted":textDecoration.Pen.DashStyle = DashStyles.Dot;break;case "dash":textDecoration.Pen.DashStyle = DashStyles.Dash;break;case "dotDash":textDecoration.Pen.DashStyle = DashStyles.DashDot;break;case "dotDotDash":textDecoration.Pen.DashStyle = DashStyles.DashDotDot;break;case "none":default:// If underline type is none or unsupported then it will be ignored.return null;}return textDecorations;}private IDisposable SetCurrent(TextElement current){return new CurrentHandle(this, current);}private struct CurrentHandle : IDisposable{private readonly DocxToFlowDocumentConverter converter;private readonly TextElement previous;public CurrentHandle(DocxToFlowDocumentConverter converter, TextElement current){this.converter = converter;this.converter.AddChild(current);this.previous = this.converter.current;this.converter.current = current;}public void Dispose(){this.converter.current = this.previous;}}}
}

,最后,在MainWindow.xaml代码:

<Window x:Class="WpfEmbeddedDocx.MainWindow"xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"xmlns:d="http://schemas.microsoft.com/expression/blend/2008"xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"xmlns:local="clr-namespace:WpfEmbeddedDocx"mc:Ignorable="d"Title="MainWindow" Height="450" Width="800"><Grid><DockPanel><Menu DockPanel.Dock="Top"><MenuItem Header="_Open file..." Click="OnOpenFileClicked"/></Menu><FlowDocumentScrollViewer Name="FlowDocumentScrollViewer"></FlowDocumentScrollViewer></DockPanel></Grid>
</Window>

MainWindow.cs的代码:

using System.IO;
using System.Windows;
using System.Windows.Controls;
using Microsoft.Win32;namespace WpfEmbeddedDocx
{public partial class MainWindow : Window{public MainWindow(){InitializeComponent();}private void ReadDocx(string path){using (var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)){var flowDocumentConverter = new DocxToFlowDocumentConverter(stream);flowDocumentConverter.Read();FlowDocumentScrollViewer.Document = flowDocumentConverter.Document;this.Title = Path.GetFileName(path);}}private void OnOpenFileClicked(object sender, RoutedEventArgs e){var openFileDialog = new OpenFileDialog(){DefaultExt = ".docx",Filter = "Word documents (.docx)|*.docx"};if (openFileDialog.ShowDialog() == true)this.ReadDocx(openFileDialog.FileName);}}
}

这样就能实现视频中的效果啦。。

下载链接:https://pan.baidu.com/s/1UO9GYYsUmoPWd49aVGR4rQ 

提取码:bybq 

原Git仓库代码地址:https://github.com/ArtMalykhin/wpf-embedded-docx

感谢作者无私分享

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/301694.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

李国庆离开当当,广东消委会告长隆,智能校服提供定位功能,全球首个5G火车站来了,这就是今天的大新闻...

今天是2月21日农历正月十七今天下雨 出门忘带雨伞但是心情还是美丽的因为我没被淋湿下面是今天的大新闻李国庆宣布离开一手创办的当当 &#xff08;界面新闻&#xff09;2月20日上午&#xff0c;当当联合创始人李国庆正式宣布&#xff0c;将离开自己一手创办并为之奋斗19年的…

Source Generators(源代码生成器)的调试器支持 | Visual Studio 2019(16.10)新功能试用...

开始之前Source Generators旨在启用编译时间元编程&#xff0c;即可以在编译时间创建并添加到编译中的代码。首先用一个Demo为不了解Source Generators的朋友演示一下功能。Source Generators详细说明请参看Source Generators Cookbook[1]创建一个ClassLibrary1项目&#xff08…

程序猿专属成语 get√

全世界只有3.14 % 的人关注了数据与算法之美成语简直是中华文化底蕴一大精华&#xff0c;当程序员和成语联系上了&#xff0c;就有了下面这些火的不行的新兴成语。你还知道哪些关于程序猿的成语&#xff0c;欢迎留言分享。版权归原作者所有&#xff0c;转载仅供学习使用&#x…

哼!看你能坚持多久

21在行为心理学中&#xff0c;人们把一个人的新习惯或理念的形成并得以巩固至少需要21天的现象&#xff0c;称之为21天效应。今天一数&#xff0c;好巧&#xff01;居然我的公众号已经连续发布了21天&#xff08;本文是第22天&#xff09;。仅以此文记录第21天&#xff0c;与大…

.NET 6 新特性 Parallel ForEachAsync

.NET 6 新特性 Parallel ForEachAsyncIntro在 .NET 6 中有一个 API Parallel.ForEachAsync 在官方的博客中一直被忽略&#xff0c;但是我觉得这个 API 非常的实用&#xff0c;类似于同步版本的 Parallel.ForEach&#xff0c;可以比较高效地控制多个异步任务的并行度。之前的版本…

住宅按套内面积算,医院人脸识别黄牛,DNA碱基对可能会扩充,菜鸟发布供应链系统,猪瘟不影响食品安全,这就是今天的大新闻...

今天是2月23日农历正月十九今天的我瑟瑟发抖真想要打火锅下面是今天的大新闻住建部新规&#xff1a;住宅按套内面积算&#xff08;中国新闻网&#xff09;“住宅建筑应以套内使用面积进行交易。”住房和城乡建设部公布的一项新规征求意见稿显示&#xff0c;房地产交易将正式告别…

mac中的放置java类库扩展的位置

2019独角兽企业重金招聘Python工程师标准>>> /Library/Java/JavaVirtualMachines/1.6.0_35-b10-428.jdk/Contents/Home/lib/ext 转载于:https://my.oschina.net/zhangdapeng89/blog/110538

WPF实现用户头像裁剪

WPF开发者QQ群&#xff1a; 340500857 前言需要做一个用户选择头像并进行裁剪。欢迎转发、分享、点赞&#xff0c;谢谢大家~。 效果预览&#xff08;更多效果请下载源码体验&#xff09;&#xff1a;一、MainWindow.xaml代码如下&#xff1a;<Grid><Border x:Name&qu…

php5.2 zengd,大对杀狗狗再犯低级错误 ZEN狂输200目笑翻棋友

弈城围棋讯 4月29日&#xff0c;DEEPZEN仍然不知疲倦的在弈城迎战各路高手。总体来讲&#xff0c;“狗狗”战绩非常优秀&#xff0c;截止今天凌晨为止&#xff0c;它的战绩为254胜43负&#xff0c;胜率为85.5%&#xff0c;强悍的一塌糊涂&#xff0c;但是&#xff0c;“狗狗”也…

专为小机械迷而造,培养STEM思维,千万别错过!物理机械力学知识边玩边学,5岁以上请入手...

▲数据汪特别推荐点击上图进入玩酷屋自从美国前总统奥巴马先生上任后对STEM教育理念重视提升到新的层次&#xff0c;全球掀起了一波又一波的STEM教育狂潮。北上广深等中小学开设STEM课程。全国《义务教育小学科学课程标准》加强综合科技知识项目&#xff0c;将力学类科技知识学…

fusioncharts同一页面显示2个仪表盘,且以java字符串作为xml数据

为什么80%的码农都做不了架构师&#xff1f;>>> fusioncharts同一页面显示2个仪表盘&#xff0c;且以java字符串作为xml数据 <% page contentType"text/html; charsetUTF-8" %> <%String path request.getContextPath(); %> <%String x…

读书 | 一切红利最终都是趋势红利

【读书总结】| 总结/Edison Zhou在去年年底就读完了刘润老师2016年出版的《趋势红利》&#xff0c;一直没有来得及做笔记整理&#xff0c;于是&#xff0c;这就来了。1所有红利最终都是趋势红利中国的企业近年来所处的环境正在发生系统性巨变&#xff0c;企业想要成功应变&…

好强大的仿生机械,这才是真正的黑科技!

全世界只有3.14 % 的人关注了数据与算法之美仿生机械就是模仿生物的形态、结构和控制原理设计制造出的功能更集中、效率更高并具有生物特征的机械。研究仿生机械的学科称为仿生机械学&#xff0c;它是20世纪60年代末期由生物学、生物力学、医学、机械工程、控制论和电子技术等学…

windows phone 8 的新特性

2019独角兽企业重金招聘Python工程师标准>>> windows phone 8 是微软windows phone系列操作系统的一次重大升级&#xff0c;在原有的基础上添加了许多新的特性。总体看来主要八中新的特性。&#xff08;Windows phone8 缩写WP8&#xff09; <1>硬件的升级 W…

oracle 数字处理函数,Oracle函数-单行函数-数字、日期、日期处理函数

函数的分类单行函数&#xff1a;一个input对应一个output&#xff0c;input和output存在一一对应的关系 如lower组函数&#xff1a;多个input&#xff0c;但是只对应一个output。如 sum()单行函数特点&#xff1a;每行返回一个结果&#xff0c;输入输出存在一一对应的关系能嵌套…

WPF 修改(优化)Menu菜单的样式

Menu菜单&#xff0c;在软件中使用率很高的一个控件。包含具有层级关系的一个或多个MenuItem作为子菜单。今天就来分享一个定义的菜单样式。看一下效果图&#xff1a;下面就来看看代码&#xff1a;本次代码&#xff0c;全部都在MainWindow.xaml内&#xff1a;<Window x:Clas…

世上最牛博士论文是这样的!

全世界只有3.14 % 的人关注了数据与算法之美第五牛博士论文就是在还没答辩之前已经发表在最好的期刊上&#xff0c;而且鉴于论文很长&#xff0c;该期刊必须像小说一样连载。实例&#xff1a;张五常博士论文《佃农理论》&#xff0c;当年在《法和经济学杂志》上连载四期。第四牛…

grep和egrep的一些简单用法

首先介绍grep的一些常见用法&#xff1a; grep&#xff1a;根据模式搜索文本&#xff0c;并将符合模式的文本行显示出来。 其基本格式为&#xff1a;grep [options] PATTERN [FILE...] 即&#xff1a;grep [选项] 匹配模式 [文件...]&#xff1b;其中&#xff0c;中括号表示该选…

WPF显示富文本emoji表情+文本(类似微信)

祝大家端午节安康&#xff01;WPF开发者QQ群&#xff1a; 340500857 前言 有小伙伴需要实现类似微信一样的气泡聊天emoji表情文本。欢迎转发、分享、点赞&#xff0c;谢谢大家~。 效果预览&#xff08;更多效果请下载源码体验&#xff09;&#xff1a;一、EmojiAndTextControl…

要孩子逻辑清晰、善于思考,别忽视空间想象力的游戏锻炼!

▲数据汪特别推荐点击上图进入玩酷屋在之前的文章时&#xff0c;马斯提到数学存在一种现象叫“梯次掉队”&#xff0c;原因在于孩子的数学思维地基没有打牢。&#xff08;传送门&#xff09;提到初中孩子需要空间想象能力时&#xff0c;很多父母疑惑为何需要&#xff1f;关于这…