AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones específicas para móviles / Funciones URI
  • Properties specific to URI variables
  • Functions that use URI variables
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
URI (Variable type)
 
The URI (Uniform Resource Identifier) type identifies physical or abstract resources (e.g. files or Web pages).
There are two types of URIs:
  • URL (Uniform Resource Locator): identifies a resource through its means of access and location..
    Examples:
    • Web address: https://www.pcsoft.fr/windevmobile/index.html
    • File location on disk: file:///C:/Users/johndoe/Documents/log.txt
  • URN (Uniform Resource Name): identify a resource by its name. They do not make it possible to locate the resource but must remain unique and persist even if the resource no longer exists or becomes unavailable.
    Example: ISBN number of a book: urn:isbn:0-395-36341-1
A URI can be represented as a character string whose syntax complies with the standard defined by RFC 3986. Each URI can contain up to five parts:
<schéma>: [//<autorité>]<chemin>[? <requête>] [ # <fragment> ]
  • The URI scheme is a letter followed by any combination of letters, numbers, plus sign (+), period (.) or dash (-) and ends with a colon (:). In the case of a URL, it generally corresponds to the protocol to be used to access the resource: http, https, ftp, etc.
  • The authority of the URI is an optional part that corresponds to the identification information to access the resource. Its format is usually:
    [<utilisateur>[:<mot de passe>]]hôte[:<port>]
  • The path is a sequence of segments separated by slashes (/). In the case of a URL on a Web page for example, it represents the path to the resource on the host.
  • The request is an optional part preceded by a? and followed by a set of pairs ' key=value' separated by '&'. In the case of a URL on a web page for example, it allows you to pass named parameters to the page.
  • The fragment is an optional part preceded by a '#' that allows providing additional information to access a secondary resource (page number, anchor of an HTML page, etc.).
Example of URI:
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Ejemplo
AndroidWidget Android
// Ouvre la fenêtre système pour la sélection d'une image 
UriRessource is URI = URISélecteur(uriImage)
IF NOT ErrorOccurred THEN
	// Chargement de la ressource
	URIToBuffer(UriRessource, ProcChargement)
	INTERNAL PROCEDURE ProcChargement(bResultat, buffer)
		IF bResultat THEN
			// Enregistrement de l'image dans la base de données
			HLinkMemo(Client, Photo, buffer)
			HModify(Client)
		END
	END
END
iPhone/iPad
// Ouvre la fenêtre système pour la sélection d'une image 
URISelect(MaProcURISélecteur, uriImage)

INTERNAL PROCEDURE MaProcURISélecteur(Succès, UriRessource)
	IF Succès = True THEN
		// Chargement de la ressource
		URIToBuffer(UriRessource, ProcChargement)
		INTERNAL PROCEDURE ProcChargement(bResultat, buffer)
			IF bResultat THEN
				// Enregistrement de l'image dans la base de données
				HLinkMemo(Client, Photo, buffer)
				HModify(Client)
			END
		END
	END
END
Propiedades

Properties specific to URI variables

The following properties can be used to handle URI variables:
Property nameType usedEffect
AuthorityCharacter string
  • "Authority" part of the URI,
  • Empty string if not specified.
This property is available in read and write mode.
FragmentCharacter string
  • Fragment of the URI,
  • Empty string if not specified.
This property is available in read and write mode.
HostCharacter string
  • Host of the URI,
  • Empty string if not specified.
This property is available in read and write mode.
Warning: If the Host property is modified:
  • the properties User and Password are reset: these two properties must then be filled in..
  • the Port property is reset: the Port property must also be set.
PathCharacter stringPath of the URI.
This property is available in read and write mode.
PortInteger
  • Port number (between 1 and 65365),
  • 0 if not specified.
This property is available in read and write mode.
QueryCharacter string
  • Query found in the URI,
  • Empty string if not specified.
This property is available in read and write mode.
SchemeCharacter stringScheme found in the URI.
If changes are made, this property is mandatory and cannot be empty.
This property is available in read and write mode.
UserCharacter stringUsername.
This property is available in read and write mode.
UserPasswordCharacter string
  • User password,
  • Empty string if not specified.
This property is available in read and write mode.
ValueCharacter stringComplete URI.

You can use VariableReset to reset the contents of a variable of type URI.
Observaciones

Functions that use URI variables

The following functions handle URI variables:
BufferToURIGuarda el contenido de un buffer en una Resource identificada por su URI.
FileToURIGuarda el contenido de un archivo en una Resource identificada por su URI.
URIGetInfoRetrieves information of a URI resource.
URISelectAbre una ventana del sistema para seleccionar una Resource de:
  • desde el sistema de archivos de dispositivos,
  • desde la nube (Google Drive, Microsoft OneDrive, etc.)
  • o desde uno de los gestores de contenidos instalados en el dispositivo.
URIToBufferCarga en el fondo el contenido de un Resource (imagen, texto, etc.) identificado por su URI en un buffer Variable.
URIToFileSaves, in the background, the content of a resource (image, text, etc.) identified by its URI in an external file.
Ver también
Versión mínima requerida
  • Versión 24
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 20/09/2024

Señalar un error o enviar una sugerencia | Ayuda local