C#
C#
Load XML from a Remote URL
Demonstrates how to load XML from a remote URL, such as https://www.chilkatsoft.com/hamlet.xmlChilkat C# Downloads
bool success = false;
// This example assumes the Chilkat HTTP API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
Chilkat.StringBuilder sbXml = new Chilkat.StringBuilder();
// Download the XML from the URL into sbXml
success = http.QuickGetSb("https://www.chilkatsoft.com/hamlet.xml",sbXml);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
Chilkat.Xml xml = new Chilkat.Xml();
// Load the XML contained in sbXml
success = xml.LoadSb(sbXml,true);
if (success == false) {
Debug.WriteLine(xml.LastErrorText);
return;
}
Debug.WriteLine("Success.");