Question Re: .Network.DownloadFile()

Saldash

New member
Joined
Jun 14, 2010
Messages
2
Programming Experience
1-3
Re: .Network.DownloadFile()

Hi folks, I hope this is the correct place to post a query like this.


I have an application in development at the moment, and in order for it to detect an Internet Connection, I use:
VB.NET:
Function IsConnected() As Boolean
        Try
            My.Computer.Network.DownloadFile("http://www.mydomain.com/isonline.txt", "app_tool.dll", "", "", True, 100, True)
            If My.Computer.FileSystem.GetFileInfo("app_tool.dll").Length > 1 Then
                Return True
            End If
        Catch
            Return False
        End Try
    End Function
This works fine when the parameter for showUI As Boolean is set to TRUE..
But, when that value is true, I get a download dialog box which I don't want.

After consulting my vb.net book, the parameter for showUI as Boolean I find is usually set to False by Default, but when I change mine from True to False, the download stop working and the function returns FALSE.

Any ideas please?
 
I heard using web client was slow and inefficient, that's why I used
My.Computer.Network.DownloadFile()

As part of my application, which will utilise some custom php scripting from the server to provide return info.. I need it to download a reasonably small (actually tiny) file..

I thought I was being clever in combining the two functions.. but apparently I was wrong.. Oh well.. hey ho.

Time to read up in WebClient then ;)

Thanks for the reply!
 
Last edited:
I heard using web client was slow and inefficient, that's why I used
My.Computer.Network.DownloadFile()
My..Network Download/Upload functions is using WebClient class for transport, ie the same thing.
 
Back
Top