» »

[VB] kako zaznati bluetooth telefon?

[VB] kako zaznati bluetooth telefon?

jishiri ::

Zdravo!

zanima me ce je kdo ze imel kake podvige glede bluetooth naprav, namrec bi rad spisal preprost program, a se je ze na zacetku zataknilo in ne vem kako zaceti...

nekaksen potek:

- odkriti napravo pridobiti ime in naslov
- ce je pravi telefon ki ga isce
- izvrsiti kill process (recimo notepad.exe)
- ob izgubitvi signala tega telefona
- izversitev ponovnega zagona aplikacije (recimo notepad.exe)


ze v naprej se zahvaljujem za pomoč



LP, JM

jishiri ::

Imports System.Net
Imports System.IO
Imports InTheHand.Net
Imports InTheHand.net.Bluetooth
Imports InTheHand.Net.Sockets


Public Class Form1
    Dim count As Integer
    Dim startm As Integer

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Enabled = True
        Timer2.Enabled = True
        count = 0
        startm = 0
    End Sub


    Private Sub Timer1_Timer()
        count = count + 1
        If count = "5" And startm = 0 Then
            startm = 0
            count = 0
            'shell process()
            lstbx.Items.Add("No Bluetooth Devices Found")
            lstbx.Items.Add("Monitoring Started...")
        End If
    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        startm = 0
        lstbx.Items.Clear()

        'BluetoothRadio.PrimaryRadio.Mode = RadioMode.Connectable

        Dim client As New BluetoothClient()
        Dim devices As BluetoothDeviceInfo() = client.DiscoverDevices()
        Dim headsetAddress As BluetoothAddress = Nothing
        Dim device As BluetoothDeviceInfo


        For Each device In devices
            If device.DeviceName = "" Then
                lstbx.Items.Add(device)
                If device.DeviceName = "LGuk" Then
                    lstbx.Items.Add("Bluetooth Devices Found")
                    lstbx.Items.Add("Monitoring Stoped...")
                    headsetAddress = device.DeviceAddress
                    startm = 1
                    'Kill()

                End If
            End If
        Next device


        'Dim headset As New BluetoothEndPoint(headsetAddress, BluetoothService.Headset)
        'client.Connect(headset)
        'Dim myStream As Stream = client.GetStream()

    End Sub


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
End Class



am ja tole mi je za 1x ratalo spacati...

Zgodovina sprememb…

  • spremenilo: jishiri ()


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

Visual Basic

Oddelek: Programiranje
313461 (2487) cekr
»

vb.net: dynamic textbox

Oddelek: Programiranje
51188 (1078) saule
»

Visual Studio - koda za prikaz OS?

Oddelek: Programiranje
91087 (854) detroit
»

[VB] Komunikacija s serijskimi napravami

Oddelek: Programiranje
412314 (1588) mNeRo
»

VB.net MDI in formi splošno

Oddelek: Programiranje
91621 (1564) strel

Več podobnih tem