Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.08 KB | None | 0 0
  1.     Private Function CheckForProtocolMessage() As String
  2.         Dim arguments As String() = Environment.GetCommandLineArgs()
  3.         If arguments.Length > 1 Then
  4.             Dim args As String() = arguments(1).Split(":")
  5.             If args(0).Trim().ToUpper() = "savesharer" AndAlso args.Length > 1 Then
  6.                 Dim actionDetail As String() = args(1).Split("?")
  7.                 If actionDetail.Length > 1 Then
  8.                     Select Case actionDetail(0).Trim().ToUpper()
  9.                         Case "opensave"
  10.                             Dim details As String() = actionDetail(1).Split("=")
  11.                             If details.Length > 1 Then
  12.                                 Dim id As String = details(1).Trim()
  13.                                 Return id
  14.                             End If
  15.                             Exit Select
  16.                     End Select
  17.                 End If
  18.             End If
  19.     else   
  20.    
  21.     Retrun "N/A"
  22.  
  23.         End If
  24.  
  25.      End Function
  26.  
  27.  
  28. Usage
  29.  
  30. Dim ID as string = checkforprotocolmessage
  31. If not id = "N/A" then
  32. 'do stuff here
  33. end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement