Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Internet konekcija

[es] :: Visual Basic 6 :: Internet konekcija

[ Pregleda: 5237 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

kiky
Petrovic Zoran
Beograd

Član broj: 37045
Poruke: 121
*.smin.sezampro.yu.



Profil

icon Internet konekcija18.01.2005. u 22:27 - pre 234 meseci
Molim vas da mi pomognete. Pisem program za brojanje impulsa i vremena provedenog na internetu pa mi je potrebno da se program aktivira u trenutku kad se uspostavi veza sa internetom da bih onda merio vreme provedeno dok se ne diskonektuje. Ne znam kako da od Windowsa dobijem informaciju da je povezan sa internetom. Hvala unapred.
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net.

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: Internet konekcija19.01.2005. u 09:19 - pre 234 meseci
Code:

Private Declare Function InetIsOffline Lib "url.dll" (ByVal dwFlags As Long) As Long
Private Sub Form_Load()
    'KPD-Team 2001
    'URL: http://www.allapi.net/
    'E-Mail: [email protected]
    'InetIsOffline returns 0 if you're connected
    MsgBox "Are you connected to the internet? " + _
    CStr(CBool(Not (InetIsOffline(0)))), vbInformation
End Sub


Code:

Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" _
(ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, _
ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long
Dim sConnType As String * 255
Private Sub Form_Load()
    Dim Ret As Long
    Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
    If Ret = 1 Then
        MsgBox "You are connected to Internet via a " & sConnType, vbInformation
    Else
        MsgBox "You are not connected to internet", vbInformation
    End If
End Sub

 
Odgovor na temu

kiky
Petrovic Zoran
Beograd

Član broj: 37045
Poruke: 121
*.dialup.sezampro.yu.



Profil

icon Re: Internet konekcija19.01.2005. u 23:54 - pre 234 meseci
Hvala na pomoci. Imam samo jos jedno pitanje. Kako iz promenjive sConnType koja je duzine 255 da izdvojim samo ono sto je u njoj bez praznih polja. Probao sam sa komandom Trim$(sConnType) ali mi ne ide.
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net.

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: Internet konekcija20.01.2005. u 09:20 - pre 234 meseci
Probaj ovako

Code:

Private Declare Function InternetGetConnectedStateEx Lib "wininet.dll" _
(ByRef lpdwFlags As Long, ByVal lpszConnectionName As String, _
ByVal dwNameLen As Integer, ByVal dwReserved As Long) As Long

Dim sConnType As String

Private Sub Form_Load()
    Dim Ret As Long
    Dim Pos As Long
    
    sConnType = Space(255)
    Ret = InternetGetConnectedStateEx(Ret, sConnType, 254, 0)
    Pos = InStr(sConnType, vbNullChar)
    If Pos > 0 Then sConnType = Left(sConnType, Pos - 1)
    If Ret = 1 Then
        MsgBox "You are connected to Internet via a " & sConnType, vbInformation
    Else
        MsgBox "You are not connected to internet", vbInformation
    End If
End Sub


 
Odgovor na temu

[es] :: Visual Basic 6 :: Internet konekcija

[ Pregleda: 5237 | Odgovora: 3 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.