Answer the question
In order to leave comments, you need to log in
How to form an HTML table from an array (in which XML is written)?
There is such a code
using System;
using System.Net;
using System.IO;
using System.Linq;
using System.Xml.Linq;
namespace MakeAGETRequest_charp
{
class Class1
{
static void Main(string[] args)
{
string sURL;
sURL = //ссылка на XML
WebRequest wrGETURL;
wrGETURL = WebRequest.Create(sURL);
var singleOptIns = System.Xml.Linq.XDocument.Load(wrGETURL.GetResponse().GetResponseStream()).
Element("Data")?.Element("Lists")?.Elements().Where(el => el.Name.LocalName == "List").
Select(el => el.Element("OptInMode")).Where(el => el?.Value == "SingleOptIn").ToArray();
var DoubleOptIns = System.Xml.Linq.XDocument.Load(wrGETURL.GetResponse().GetResponseStream()).
Element("Data")?.Element("Lists")?.Elements().Where(el => el.Name.LocalName == "List").
Select(el => el.Element("OptInMode")).Where(el => el?.Value == "DoubleOptIn").ToArray();
Stream objStream;
objStream = wrGETURL.GetResponse().GetResponseStream();
StreamReader objReader = new StreamReader(objStream);
Console.Write(singleOptIns);
Console.ReadLine();
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question