当前位置: 首页>>代码示例>>C#>>正文


C# HtmlDocument.Save方法代码示例

本文整理汇总了C#中HtmlDocument.Save方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlDocument.Save方法的具体用法?C# HtmlDocument.Save怎么用?C# HtmlDocument.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HtmlDocument的用法示例。


在下文中一共展示了HtmlDocument.Save方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

 static void Main(string[] args)
 {
     HtmlDocument doc = new HtmlDocument();
     doc.Load(@"..\..\mshome.htm");
     doc.OptionOutputAsXml = true;
     doc.Save("mshome.xml");
 }
开发者ID:AlexanderByndyu,项目名称:HtmlAgilityPack,代码行数:7,代码来源:Html2Xml.cs

示例2: StackOverflow

		public void StackOverflow()
		{
			var url = "http://rewarding.me/active-tel-domains/index.php/index.php?rescan=amour.tel&w=A&url=&by=us&limits=0";
			var request = WebRequest.Create(url);
			var htmlDocument = new HtmlDocument();
			htmlDocument.Load((request.GetResponse()).GetResponseStream());
			Stream memoryStream = new MemoryStream();
			htmlDocument.Save(memoryStream);
		}
开发者ID:ToFuKing,项目名称:HtmlAgilityPack,代码行数:9,代码来源:HtmlDocumentTests.cs

示例3: Test_Constructing_Node_With_Single_Attribute

        public void Test_Constructing_Node_With_Single_Attribute()
        {
            var doc = new HtmlDocument();
            var a = doc.CreateElement("a");
            a.SetAttributeValue("href", "foo");
            a.InnerHtml = "foo";

            doc.DocumentNode.AppendChild(a);

            Assert.AreEqual("<a href=\"foo\">foo</a>", doc.Save());
        }
开发者ID:moby41,项目名称:HtmlAgilityPack,代码行数:11,代码来源:HtmlDocumentTests.cs

示例4: Test_Parse_Attribute_Containing_Quote

 public void Test_Parse_Attribute_Containing_Quote()
 {
     var doc = new HtmlDocument("<html><head></head><body><a href=\"f'o'o\">yo</a></body></html>");
     Assert.AreEqual("<html><head></head><body><a href=\"f'o'o\">yo</a></body></html>", doc.Save());
 }
开发者ID:moby41,项目名称:HtmlAgilityPack,代码行数:5,代码来源:HtmlDocumentTests.cs

示例5: Test_SaveXML_Does_Not_Change_Quotes_On_Attributes

        public void Test_SaveXML_Does_Not_Change_Quotes_On_Attributes()
        {
            var doc = new HtmlDocument("<html><head></head><body><a href=\"foo\">yo</a></body></html>");
            Assert.AreEqual("<html><head></head><body><a href=\"foo\">yo</a></body></html>", doc.Save());

            doc = new HtmlDocument("<html><head></head><body><a href='foo'>yo</a></body></html>");
            Assert.AreEqual("<html><head></head><body><a href='foo'>yo</a></body></html>", doc.Save());
        }
开发者ID:moby41,项目名称:HtmlAgilityPack,代码行数:8,代码来源:HtmlDocumentTests.cs

示例6: Test_SaveXML_Does_Not_Add_Value_To_Attribute_Without_Value_When_Loading

        public void Test_SaveXML_Does_Not_Add_Value_To_Attribute_Without_Value_When_Loading()
        {
            var doc = new HtmlDocument("<html><head></head><body><a href=\"\">yo</a></body></html>");

            var html = doc.Save();

            Assert.AreEqual("<html><head></head><body><a href=\"\">yo</a></body></html>", html);
        }
开发者ID:moby41,项目名称:HtmlAgilityPack,代码行数:8,代码来源:HtmlDocumentTests.cs

示例7: Test_SaveXML_Does_Not_Add_Quote_To_Attribute_Loading_And_Attribute_Is_Not_Empty

        public void Test_SaveXML_Does_Not_Add_Quote_To_Attribute_Loading_And_Attribute_Is_Not_Empty()
        {
            var doc = new HtmlDocument("<html><head></head><body><a href=foo>yo</a></body></html>");

            var html = doc.Save();

            Assert.AreEqual("<html><head></head><body><a href=foo>yo</a></body></html>", html);
        }
开发者ID:moby41,项目名称:HtmlAgilityPack,代码行数:8,代码来源:HtmlDocumentTests.cs


注:本文中的HtmlDocument.Save方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。