Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / June 2007



Tip: Looking for answers? Try searching our database.

FTP client problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Egg - 21 Jun 2007 15:19 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.