(HTML相关问题)
已知:
当前URL , 相对URL , 如何将相对URL 转换为绝对URL
例如:
已知页面当前的URL为
http://community.csdn.net/Expert/topic/xxxxx.asp
页面中的某个链接的href值为 ../link.asp
显然该链接的绝对地址应该为:http://community.csdn.net/Expert/link.asp请问 哪位有这样的函数 ,
补充:
相对 URL 有很多地方需要注意,
每个 ../ 表示上一级目录
./ 表示当前目录 ,可加可不加
/ 表示根目录
已知:
当前URL , 相对URL , 如何将相对URL 转换为绝对URL
例如:
已知页面当前的URL为
http://community.csdn.net/Expert/topic/xxxxx.asp
页面中的某个链接的href值为 ../link.asp
显然该链接的绝对地址应该为:http://community.csdn.net/Expert/link.asp请问 哪位有这样的函数 ,
补充:
相对 URL 有很多地方需要注意,
每个 ../ 表示上一级目录
./ 表示当前目录 ,可加可不加
/ 表示根目录
var Buffer:array[0..MAX_PATH - 1] of Char;
cBuf:Cardinal;
begin
cBuf:=sizeof(Buffer);
InternetCombineUrl(PChar(CurPath),PChar(DirPath),
Buffer,cBuf,ICU_BROWSER_MODE);
Result:=StrPas(Buffer);
end;要引用单元:WinInet
调用举例:
ShowMessage(GetAbsPath('http://community.csdn.net/Expert/topic/xxxxx.asp',
'../link.asp'));