Normally, XML files are read from static files, but XML data is updated at any time in the securities field.
For example, if a third party wants us to provide XML data, we develop it for the second party, and the third party provides us withURL, ThisURLThe content is in XML format and contains the data we need.
Can I tell you how to read static files?URLIs the method the same? Just Replace "data. xml" with "http://www.yesky.com/news/stock.asp? Code = 0002 ????
A: It can be implemented in this way. Please referC #Code
See the following code:
Using system;
Using system. IO;
Using system. xml;
Public class sample
{
Public static void main ()
{
// Create the xmldocument.
Xmldocument Doc = new xmldocument ();
// Load the XML file from a remoteURL
Doc. Load ("http://www.yesky.com/news/stock.asp ");
Doc. Save (console. Out );
}
}
In this way,C #ProgramThe XML uploaded from the remote ASP page is displayed on the console. Out (console output.