' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
﻿Imports System
Imports System.Security
Imports System.Web
Imports System.Xml

Namespace E
    Public Class Program
        Public Shared Sub Main(args As String())
            Dim s As String = "http://test.dk/PermalinkViewer.htmx?viewId=1&linkType=htmlType"
            Console.WriteLine(s)
            Dim s1 As String = HttpUtility.UrlEncode(s)
            Console.WriteLine(s1)
            Dim s2 As String = SecurityElement.Escape(s)
            Console.WriteLine(s2)
            Using xw As XmlWriter = XmlTextWriter.Create(Console.Out)
                xw.WriteStartDocument()
                xw.WriteElementString("url", s)
                xw.WriteEndDocument()
            End Using
        End Sub
    End Class
End Namespace
