none
link in webbrowser do stuff in program

    Question

  • Sorry for the title, i don't know how to explain..

    I need to make a webpage that have a link, that when i click it, it will do some stuff in my program (Like spotify's "spotify:track:2Vh4X3dkYbTF8hOd1j0kAg" link) How do i do this?

    I am doing a music program, so it's almost precisly as spotify

    • Moved by Bob_BaoMVP Tuesday, April 10, 2012 7:02 AM (From:Visual Basic Language)
    Friday, April 06, 2012 4:30 PM

All replies

  • You can easily do that if you are using a WebBrowserControl. Grab the URL of the link clicked from WebBrowserControl Navigating event. Here is an example:

    Private Sub webBrowser1_Navigating(ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs) Handles webBrowser1.Navigating
    'Which Link User Clicked
    UserClickedThis=e.Url.ToString()
    
    'You can even prevent user from being navigated using this
    'e.cancel=True
    End Sub

    Thanks.


    If my post answers your question then mark as answer.

    Saturday, April 07, 2012 7:37 AM
  • You can easily do that if you are using a WebBrowserControl. Grab the URL of the link clicked from WebBrowserControl Navigating event. Here is an example:

    Private Sub webBrowser1_Navigating(ByVal sender As Object, ByVal e As WebBrowserNavigatingEventArgs) Handles webBrowser1.Navigating
    'Which Link User Clicked
    UserClickedThis=e.Url.ToString()
    
    'You can even prevent user from being navigated using this
    'e.cancel=True
    End Sub

    Thanks.


    If my post answers your question then mark as answer.

    yes, but i need it to be from a external browser like chrome, ie or firefox.. (hopefully all..)
    Saturday, April 07, 2012 12:21 PM
  • In that case you need to create a plugins that will run in background and track user activities in browser. Here is a helpful link:

    http://www.add-in-express.com/programming-internet-explorer/developing-addons.php

    Thanks.


    If my post answers your question then mark as answer.

    Saturday, April 07, 2012 12:45 PM
  • In that case you need to create a plugins that will run in background and track user activities in browser. Here is a helpful link:

    http://www.add-in-express.com/programming-internet-explorer/developing-addons.php

    Thanks.


    If my post answers your question then mark as answer.

    There should be app links if im not totally wrong.. like Spotify:, magnet:, steam:, etc..

    i found this, but there is no code examples.. http://www.daniweb.com/software-development/vbnet/threads/284869/create-a-application-protocol

    Saturday, April 07, 2012 2:01 PM
  • Hi swehuter2000,

    Thanks for your post.

    As I read your thread, I confused by your goals.

    The webbrowser is a control to display the webpage. According to your description, it seems that you are looking for a way to create a special link in the webpage. It has far relationship with VB.Net. 

    If I misunderstood, please feel free to let me know.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 09, 2012 10:02 AM
  • Hi swehuter2000,

    Thanks for your post.

    As I read your thread, I confused by your goals.

    The webbrowser is a control to display the webpage. According to your description, it seems that you are looking for a way to create a special link in the webpage. It has far relationship with VB.Net. 

    If I misunderstood, please feel free to let me know.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    By webbrowser i don't mean the webbrowser control, i mean the Webbrowser on you computer (Internet explorer, Firefox, Chrome, Opera, Safari, etc..)
    Monday, April 09, 2012 3:32 PM
  • Hi swehunter2000,

    As far as I know, VB.Net is not suitable for doing this. So would you like to show in which ways you want to deal with your goals, PHP, JSP, or ASP.Net?


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 10, 2012 5:08 AM
  • Hi swehunter2000,

    As far as I know, VB.Net is not suitable for doing this. So would you like to show in which ways you want to deal with your goals, PHP, JSP, or ASP.Net?


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    I'll be using PHP..
    Tuesday, April 10, 2012 6:06 AM
  • Hi Swehunter2000,

    As I mentioned, this queue is about Visual Basic. I’m afraid that your topic about creating a link in webpage using PHP is unsuitable here. I will move this thread to off topic forum. You can connect to the PHP official website to ask for help: http://www.php.net/.

    Sorry for any inconvenience and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 10, 2012 6:44 AM
  • Hi Swehunter2000,

    As I mentioned, this queue is about Visual Basic. I’m afraid that your topic about creating a link in webpage using PHP is unsuitable here. I will move this thread to off topic forum. You can connect to the PHP official website to ask for help: http://www.php.net/.

    Sorry for any inconvenience and have a nice day.


    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Ill just be using PHP to create the "Brainstom:open:id6483692" but how do i make my program (made in VB.NET) detect and open it?
    Tuesday, April 10, 2012 2:16 PM
  • Hi swehunter2000,

    If you want to open it, you can just use the browsers in your PC to open it. If you want to open it with the VB.Net application, you can simply use Webbrowser Control to open it. But using Webbrowser Control or IE to open it is at the same, because the core of Webbrowser Control is IE. So all of these ways just OPEN the webpage, and can’t edit or make some changes to it. So all the features you want to have in the webpage need to be handled in the PHP side.

    If you want to open it in VB.Net application, you can add a Webbrowser Control to your application and add the local path to the WebBrowser.Navigate Method.

    Here is some information and sample code about WebBrowser Class: http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx

    Hope this will be clearer.



    Mark Liu-lxf [MSFT]
    MSDN Community Support | Feedback to us

    Wednesday, April 11, 2012 2:55 AM