tôi sẽ đi qua các tập tin xml như thế này:Làm thế nào để đọc file XML sử dụng System.IO.Stream với LINQ
File1.PostedFile.InputStream
//reading xml file.....
public static void readXMLOutput(Stream stream)
{
System.Xml.Linq.XDocument xml = System.Xml.Linq.XDocument.Load(stream);
var query = from p in xml.Element("ste").Element("Application")
//where (int)p.Element("Id") == 1
select Page;
foreach (var record in query)
{
Response.Write("dfe") + record.Element("dfe").Value;
}
lỗi:
Error 1 The best overloaded method match for 'System.Xml.Linq.XDocument.Load(string)' has some invalid arguments
cannot convert from 'System.IO.Stream' to 'string'
vâng tôi đang sử dụng 3.5 khung công tác. những gì nên được thay thế cho nó? –
bạn có thể vui lòng chỉ cho tôi một số dòng mẫu Stream bằng xmlReader không? –
@teki: Đã chỉnh sửa để đưa ra một phương pháp bạn có thể sử dụng. –