ولی بد نیست کد زیر رو هم امتحان کنید.
البته کد زیر در صورتی کار می کند که گزینه ی 'Never Dial a Connection' در Internet options/connections انتخاب نشده باشد.
Option Explicit
Private Const INTERNET_AUTODIAL_FORCE_ONLINE = 1
Private Const INTERNET_AUTODIAL_FORCE_UNATTENDED = 2
Private Declare Function InternetAutodialHangup Lib "wininet.dll" (ByVal dwReserved As Long) As Long
Private Declare Function InternetAutodial Lib "wininet.dll" (ByVal dwFlags As Long, ByVal dwReserved As Long) As Long
' !! Dial the Net Automatically !!
' This waits until the connection is made and THEN proceeds.
Private Sub Command1_Click()
'To prompt the user to connect to the Net
If InternetAutodial(INTERNET_AUTODIAL_FORCE_ONLINE, 0) Then
MsgBox "You're Connected!", vbInformation
End If
'To automatically start dialling
If InternetAutodial(INTERNET_AUTODIAL_FORCE_UNATTENDED, 0) Then
MsgBox "You're Connected!", vbInformation
End If
'To disconnect an automatically dialled
' connection
If InternetAutodialHangup(0) Then
MsgBox "You're Disconnected!", vbInformation
End If
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum