Dear All,
I am using the following code to write a ftp client. If someone use IE and
checked "Work OffLine", then I won't be able to connect ftp site. If uncheck
"Work offline" at IE, then my program is work.
How to avoid someone checked "Work offline" under IE? Your help is highly
appreciated.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
hConnection = InternetConnect(hOpen, server, INTERNET_INVALID_PORT_NUMBER, _
username, password, INTERNET_SERVICE_FTP, nflag, 0)
If hConnection = 0 Then
bActiveSession = False
ConnessioneServer = False
Exit Function
Else
bActiveSession = True
ConnessioneServer = True
Exit Function
End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''
Regards,
Daryl
Brian Muth - 22 Jun 2007 17:32 GMT
Since no one else has posted an answer, I thought I'd post a suggestion....
You can find out if the user is offline by looking at the registry entry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\GlobalUserOffline. If it is set to one, you can set it to zero.
You must do this before you load the Wininet.dll (ie, before you call your
first InternetConnect).
Unfortunately, if there is an instance of Internet Explorer running at the
time, I'm afraid you are doomed, as you will link to the already running
Wininet.dll and that dll has already read the registry value.
HTH,
Brian
> Dear All,
>
[quoted text clipped - 28 lines]
>
> Daryl
Egg - 24 Jun 2007 08:24 GMT
Dear Brian,
Thank you very much for your suggestion.
Regards,
Daryl
> Dear All,
>
[quoted text clipped - 4 lines]
> How to avoid someone checked "Work offline" under IE? Your help is highly
> appreciated.
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> ''''''''''''''''''''
> hConnection = InternetConnect(hOpen, server, INTERNET_INVALID_PORT_NUMBER, _
[quoted text clipped - 8 lines]
> Exit Function
> End If
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
> ''''''''''''''''''''
>
> Regards,
>
> Daryl