Ver Mensaje Individual
  #1649  
Antiguo 28-09-2021
unomasmas unomasmas is offline
Miembro
 
Registrado: dic 2019
Posts: 112
Reputación: 5
unomasmas Va por buen camino
Cita:
Empezado por ermendalenda Ver Mensaje
Código:
Codigo_uri=TEXT_TO_codigo_uri(texto_origen)
FUNCTION TEXT_TO_codigo_uri(bufo)

    For a = 1 To Len(bufo)
        sql_buff = Mid(bufo, a, 1)
        sql_buff = LTrim(Hex(Asc(sql_buff)))
        If Len(sql_buff) = 1 Then
            sql_buff = "0" & sql_buff
        End If
        TEXT_TO_codigo_uri = TEXT_TO_codigo_uri & "%" & sql_buff
         
    Next
END FUNCTION
Con .Net se hace con una línea (https://docs.microsoft.com/en-us/dot...capedatastring):
Código:
private string GetURLEncodedString(string inputString)
{
    string result = Uri.EscapeDataString(inputString);
    return result;
}

Última edición por unomasmas fecha: 28-09-2021 a las 23:43:42. Razón: Pongo la función completa...
Responder Con Cita