Частная статическая строка ConvertToabSoluteUrls (String html, URI RelativeLocation) {
ihtmldocument2 doc = new htmldocumentclass ();
doc.write (новый объект [] {html});
doc.close ();
foreach (якорь ihtmlanchorement в doc.links) {
Ihtmlelement element = (ihtmlelement) якорь;
string href = (string) element.getAttribute ("href", 2);
if (href! = null) {
uri addr = new Uri (RelatiEvelocation, href);
Anchor.href = addr.absoluteuri;
}
}
foreach (ihtmlimgelement image в doc.images) {
Ihtmlelement element = (ihtmlelement) изображение;
string src = (string) element.getAttribute ("src", 2);
if (src! = null) {
uri addr = new Uri (RelatiEvelocation, SRC);
image.src = addr.absoluteuri;
}
}
string ret = doc.body.innerhtml;
вернуть вт;
}