![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Example: Http.ExtractMetaRefreshUrl methodDemonstrates the
integer li_rc integer li_Success oleobject loo_Http oleobject loo_Sb integer li_BCrlf string ls_Url li_Success = 0 loo_Http = create oleobject li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if // Sample HTML with a META refresh. // <!DOCTYPE html> // <html lang="en"> // <head> // <meta charset="utf-8" /> // <meta http-equiv="refresh" content="5; url=https://example.com" /> // <title>Meta Refresh Redirect</title> // </head> // <body> // <p>Redirecting to example.com in 5 seconds�</p> // </body> // </html> loo_Sb = create oleobject li_rc = loo_Sb.ConnectToNewObject("Chilkat.StringBuilder") li_BCrlf = 1 loo_Sb.AppendLine("<!DOCTYPE html>",li_BCrlf) loo_Sb.AppendLine("<html lang=~"en~">",li_BCrlf) loo_Sb.AppendLine("<head>",li_BCrlf) loo_Sb.AppendLine(" <meta charset=~"utf-8~" />",li_BCrlf) loo_Sb.AppendLine(" <meta http-equiv=~"refresh~" content=~"5; url=https://example.com~" />",li_BCrlf) loo_Sb.AppendLine(" <title>Meta Refresh Redirect</title>",li_BCrlf) loo_Sb.AppendLine("</head>",li_BCrlf) loo_Sb.AppendLine("<body>",li_BCrlf) loo_Sb.AppendLine(" <p>Redirecting to example.com in 5 seconds�</p>",li_BCrlf) loo_Sb.AppendLine("</body>",li_BCrlf) loo_Sb.AppendLine("</html>",li_BCrlf) ls_Url = loo_Http.ExtractMetaRefreshUrl(loo_Sb.GetAsString()) if loo_Http.LastMethodSuccess = 0 then Write-Debug "The HTML has no META refresh tag." else Write-Debug "META refresh URL: " + ls_Url end if destroy loo_Http destroy loo_Sb |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.