Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
- Dim ID As String = CheckForProtocolMessage()
- If Not ID = "N/A" Then
- 'do stuff with the id
- End If
- End Sub
- Private Function CheckForProtocolMessage() As String
- Dim arguments As String() = Environment.GetCommandLineArgs()
- If arguments.Length > 1 Then
- 'Use this loop tofigure out what the index of the argument you want is after you ge tthat you can take this loop out
- '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- Dim I As Integer = 0
- For Each Str As String In arguments
- MsgBox("Argument Number : " & I & vbNewLine & "Argument : " & Str)
- Next
- '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- 'The index you find will replace the 1 here
- Dim args As String() = arguments(1).Split(":")
- If args(0).Trim().ToLower() = "savesharer" AndAlso args.Length > 1 Then
- Dim actionDetail As String() = args(1).Split("?")
- If actionDetail.Length > 1 Then
- Select Case actionDetail(0).Trim().ToLower()
- Case "opensave"
- Dim details As String() = actionDetail(1).Split("=")
- If details.Length > 1 Then
- Dim id As String = details(1).Trim()
- Return id
- End If
- Exit Select
- End Select
- End If
- End If
- Else
- Return "N/A"
- End If
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement