Wireless Sinyal Seviyesi Bilgisini Almak
Tarih
04/11/2010 15:10
Konu Sahibi
gitarc
Yorumlar
0
Okunma
1522
Konuyu Oyla:
  • Derecelendirme: 5/5 - 1 oy
  • 5
  • 4
  • 3
  • 2
  • 1

Derecelendirme: 5/5 - 1 oy



gitarc
Aktif Üye
Kullanici Avatari
Aktif Üye
14
01/11/2010
0
Balıkesir
Ofis XP
02/07/2011,15:21
System.Management referansını ekliyoruz

Visual Basic Code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
 

Public Class WirelessInfo
Private _InstanceName As String
Private _Bars As Integer

Public Property InstanceName() As String
Get
Return _InstanceName
End Get
Set(ByVal value As String)
_InstanceName = value
End Set
End Property
Public Property Bars() As Integer
Get
Return _Bars
End Get
Set(ByVal value As Integer)
_Bars = value
End Set
End Property
End Class
Public Function GetWirelessSignalStrength() As List(Of WirelessInfo)

Dim searcher As ManagementObjectSearcher = Nothing
searcher = New ManagementObjectSearcher("root/WMI", "Select InstanceName,Ndis80211ReceivedSignalStrength from MSNdis_80211_ReceivedSignalStrength")
Dim adapterObjects As ManagementObjectCollection = searcher.[Get]()
Dim result As New List(Of WirelessInfo)()
For Each mo As ManagementObject In adapterObjects
Dim w As New WirelessInfo()
w.InstanceName = mo("InstanceName").ToString()
Dim intStrength As Integer = Convert.ToInt32(mo("Ndis80211ReceivedSignalStrength"))
If intStrength > -57 Then
w.Bars = 5
ElseIf intStrength > -68 Then
w.Bars = 4
ElseIf intStrength > -72 Then
w.Bars = 3
ElseIf intStrength > -80 Then
w.Bars = 2
ElseIf intStrength > -90 Then
w.Bars = 1
Else
w.Bars = 0
End If
result.Add(w)
Next
Return result
End Function

PROGRAMMER MEHMET
Cevapla







Konuyu Okuyanlar: 1 Ziyaretçi



Türkçe Çeviri: MCTR, Forum Yazılımı: MyBB, © 2002-2016 MyBB Group.
DMCA.com Protection Status
© Desing by XSTYLED| Develops by ozanakkaya