Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Classic ASP) Parse a URL into its Component PartsDemonstrates how to parse a URL into it's component parts.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% ' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Url") set url = Server.CreateObject("Chilkat.Url") urlStr = "https://www.amazon.com/Anarchy-State-Utopia-Robert-Nozick/dp/0465051006/ref=sr_1_1?s=books&ie=UTF8&qid=1430344305&sr=1-1&keywords=nozick#frag123" success = url.ParseUrl(urlStr) ' Assume success.. Response.Write "<pre>" & Server.HTMLEncode( "URL: " & urlStr) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Host: " & url.Host) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Port: " & url.Port) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "HostType: " & url.HostType) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Ssl: " & url.Ssl) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Path: " & url.Path) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Query: " & url.Query) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Frag: " & url.Frag) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "----") & "</pre>" urlStr = "http://matt:secret@www.chilkatsoft.com:8080/somepath.asp?test=123&size=2" success = url.ParseUrl(urlStr) ' Assume success.. Response.Write "<pre>" & Server.HTMLEncode( "URL: " & urlStr) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Host: " & url.Host) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Port: " & url.Port) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "HostType: " & url.HostType) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Ssl: " & url.Ssl) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Login: " & url.Login) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Password: " & url.Password) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Path: " & url.Path) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Query: " & url.Query) & "</pre>" Response.Write "<pre>" & Server.HTMLEncode( "Frag: " & url.Frag) & "</pre>" %> </body> </html> |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.