Как открыть Skype в Visual Basic 2010.

Если Skype установлен, откройте его, и если он не загружен.

 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

1 ответ1

0

этот ответ может помочь

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

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .