Article View: free.it.visual-basic
Article #1357capire se la linea è occupata
From: alex
Date: Fri, 09 Jul 2004 11:19
Date: Fri, 09 Jul 2004 11:19
102 lines
4785 bytes
4785 bytes
dopo aver usato l'api rasDial per collegarmi a internet, come faccio a
capire se eventualmente la linea � occupata.
Sto usando questo codice, ma sembra che non mi vuole rilevare questo
tipo di errore.
Dim typeOSINFO As OSVERSIONINFO
Dim lpRASCONNSTATUS As RASCONNSTATUS
Dim RASErrorNumber As Long, strRASErrorString As String
Const RASBASE As Long = 600, NOT_SUPPORTED As Long = &H8
With typeOSINFO
.dwOSVersionInfoSize = 148
GetVersionEx typeOSINFO
lpRASCONNSTATUS.dwSize = IIf(.dwPlatformId = 2, 288, 160)
End With
Do
RasGetConnectStatus hRasConn, lpRASCONNSTATUS
With lpRASCONNSTATUS
If Not .dwError Then
Select Case .RASCONNSTATE
Case RASCS_OpenPort: aggStato "Attempting To Open
Port..."
Case RASCS_PortOpened: aggStato "Port Successfully
Opened"
Case RASCS_ConnectDevice: aggStato "Attempting to
Connect Device..."
Case RASCS_DeviceConnected: aggStato "Device Opened"
Case RASCS_AllDevicesConnected: aggStato "All Devices
Connected"
Case RASCS_Authenticate: aggStato "Authenticating..."
Case RASCS_AuthNotify: aggStato "Athentication
Notification"
Case RASCS_AuthRetry: aggStato "Retrying
Authentication..."
Case RASCS_AuthCallback: aggStato "Authentication
Callback"
Case RASCS_AuthChangePassword: aggStato "Change
Password"
Case RASCS_AuthProject: aggStato "Authenticating
Project.."
Case RASCS_AuthLinkSpeed: aggStato "Authenticating
Link Speed.."
Case RASCS_AuthAck: aggStato "Athentication
Acknowlegement"
Case RASCS_ReAuthenticate: aggStato
"ReAuthentication..."
Case RASCS_Authenticated: aggStato "Authenticated"
Case RASCS_PrepareForCallback: aggStato "Prepare For
Callback"
Case RASCS_WaitForModemReset: aggStato "Waiting For
Modem Rest..."
Case RASCS_WaitForCallback: aggStato "Waiting For
Callback..."
Case RASCS_Projected: aggStato "Network Completely
Configured"
'--- Le voci seguenti sono valide solo per Windows 9x
Case RASCS_StartAuthentication: aggStato "Attempting
to Open Port"
Case RASCS_CallbackComplete: aggStato "Callback
Completed"
Case RASCS_LogonNetwork: aggStato "Logging On To
Network"
'---
Case RASCS_Interactive: aggStato "Interactive"
Case RASCS_RetryAuthentication: aggStato "Retry
Authentication"
Case RASCS_CallbackSetByCaller: aggStato "CallBack Set
By Caller"
Case RASCS_PasswordExpired: aggStato "Password
Expired"
Case RASCS_Connected
aggStato "Connected"
Exit Do
Case RASCS_Disconnected: aggStato "Disconnected"
Case Else: aggStato "Unknown State"
End Select
Else
Select Case .dwError
Case Is >= RASBASE
RasGetErrorString RASErrorNumber,
strRASErrorString, 256&
Debug.Print RASErrorNumber & "'" &
strRASErrorString
Case NOT_SUPPORTED
Debug.Print "Funzione non supportata in questa
versione di Windows"
Case Else
Debug.Print "Errore inaspettato"
End Select
RasHangUp hRasConn
Exit Do
End If
End With
DoEvents '
Loop
C'� qualche altro sistema?
Technical Details
Message-ID:
<4wo109hf.gurjnzl5.ponitq9w.t7qdqd6@afqwgpb8.sntoyw.5aums.zj08x2>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.gazeta.pl!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: f94ee,75ed7eff2029c443,start X-Google-Attributes: gidf94ee,public X-Google-Language: ENGLISH,ASCII Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.gazeta.pl!not-for-mail From: alex <ilnewsgroup@despammed.com> Newsgroups: free.it.visual-basic Subject: capire se la linea è occupata Date: Fri, 09 Jul 2004 11:19:43 GMT Organization: "Portal Gazeta.pl -> http://www.gazeta.pl" Lines: 102 Message-ID: <4wo109hf.gurjnzl5.ponitq9w.t7qdqd6@afqwgpb8.sntoyw.5aums.zj08x2> NNTP-Posting-Host: ppp-113-103.26-151.libero.it Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: inews.gazeta.pl 1089371989 6733 151.26.103.113 (9 Jul 2004 11:19:49 GMT) X-Complaints-To: usenet@agora.pl NNTP-Posting-Date: Fri, 9 Jul 2004 11:19:49 +0000 (UTC) X-User: alex.giusti X-Proces-App-Title: Power News 1.0.0