Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ' ---------------------
- ' Coded By CorrM
- ' It's [ Require Administrator Access ]
- ' ---------------------
- '
- ' Use Example
- Dim URI_Schemes As New URI_Schemes
- With URI_Schemes
- .Protocol_Name = "CorrM"
- .exe_Path = Application.ExecutablePath
- .Create()
- End With
- ' In Form Load You Can Use This Code
- MsgBox(Uri.UnescapeDataString(Environment.GetCommandLineArgs()(1)))
- ' In Browser Go To
- ' CorrM:My Name Is CorrM
- ' Or In HTML You Can Use This Code
- ' <a href="corrm:My Name Is CorrM">Click Here</a>
- '
- ' ---------------------
- Public Class URI_Schemes
- Dim _Protocol_Name As String
- Public Property Protocol_Name As String
- Get
- Return _Protocol_Name
- End Get
- Set(value As String)
- _Protocol_Name = value
- End Set
- End Property
- Dim _exe_Path As String = Application.ExecutablePath
- Public Property exe_Path As String
- Get
- Return _exe_Path
- End Get
- Set(value As String)
- _exe_Path = value
- End Set
- End Property
- Sub Create()
- With My.Computer.Registry.ClassesRoot.CreateSubKey(_Protocol_Name)
- .SetValue("", "URL:" & _Protocol_Name & " Protocol")
- .SetValue("URL Protocol", "")
- .CreateSubKey("DefaultIcon").SetValue("", _exe_Path)
- .CreateSubKey("shell").CreateSubKey("open").CreateSubKey("command").SetValue("", Chr(34) & _exe_Path & Chr(34) & " " & Chr(34) & "%1" & Chr(34))
- End With
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement