Abrir o Skype no Visual Basic 2010

0

Como abrir o Skype no Visual Basic 2010.

Se o Skype estiver instalado, abra-o e, se não estiver, baixe-o.

 Private Sub skype_Click(sender As System.Object, e As System.EventArgs) Handles skype.Click
    Dim rk As RegistryKey = Registry.ClassesRoot.OpenSubKey("skype\shell\open\command", False) '"skype\shell\open\command"
    Dim ReturnedValue As String = ""
    Try
        ReturnedValue = CStr(rk.GetValue(""))
        Dim ReturnedValueSplit() As String = ReturnedValue.Split(CChar(ChrW(34)))
        ReturnedValue = ReturnedValueSplit(1)
        ReturnedValue = ReturnedValue.Replace(CChar(ChrW(34)), "")
        If My.Computer.FileSystem.FileExists(ReturnedValue) = True Then
            System.Diagnostics.Process.Start(ReturnedValue)("C:\Program Files (x86)\Skype\Phone\Skype.exe")
        Else
            System.Diagnostics.Process.Start("http://www.skype.com/en/download-skype/skype-for-windows/downloading")
        End If

    End Try
End Sub
    
por Kelvin Ricafort 25.11.2013 / 04:07

1 resposta

0

esta resposta pode ajudar

Option Strict On

Imports Microsoft.Win32

Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    Me.CenterToScreen()
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    Dim rk As RegistryKey = Registry.ClassesRoot.OpenSubKey("skype\shell\open\command",    
False) '"skype\shell\open\command"
    Dim ReturnedValue As String = ""
    Try
        ReturnedValue = CStr(rk.GetValue(""))
        Dim ReturnedValueSplit() As String = ReturnedValue.Split(CChar(ChrW(34)))
        ReturnedValue = ReturnedValueSplit(1)
        ReturnedValue = ReturnedValue.Replace(CChar(ChrW(34)), "")
        If My.Computer.FileSystem.FileExists(ReturnedValue) = False Then
            Process.Start("http://www.skype.com/en/download-skype/skype-for-
windows/downloading/")
        Else
            Process.Start(ReturnedValue)
        End If
    Catch ex As Exception

    End Try
End Sub

End Class
    
por 26.11.2013 / 01:57