-1
用于翻译网站我加载通过htmlaglity包的网站知道在其他网站使用的图像/ JS的absloute路径。我想知道网站中引用的/ js/image/css的绝对路径。 当我这样做视图源,点击喜欢(../样式/ superfish.css)它给我的文件(https://URL名/网站/风格/ superfish.css) 的完整路径,但我想这个完整路径programmaticaly在我的web应用程序。如何通过我的web应用
源代码:
public ActionResult TransURL(string surl)
{
html = web.Load(surl);
//taking all the script tag
var nodesScript = (from ele in root.Descendants("script")
select ele);
foreach (var e in nodesScript)
{
string value = e.GetAttributeValue("src", "not found");
//here value is ../Styles/superfish.css
Uri ur = new Uri(surl);
//
Uri ur1= new Uri(ur, Url.Content(value));
}
}
显示您的一些代码工作给我们。 –
我希望你不能获得知识紧靠在服务器上的绝对路径! – TaW