download file from server error
-
hi guys i am trying to download a file from the server by suplying the correct credentials but am getting a bad username or password error. the command i am using is
My.Computer.Network.DownloadFile(My.Settings.ServerFile, My.Settings.LocalFile, "username", "password", True, 1000, True)
the username and password supplied is correct. when i click on start-> run the ip address of the server, it pops up a username and password box. i enter in the exact same credentials and it goes through. what could be wrong or is there a better way of getting the file from the server onto a local pc thanks anoop
-
hi guys i am trying to download a file from the server by suplying the correct credentials but am getting a bad username or password error. the command i am using is
My.Computer.Network.DownloadFile(My.Settings.ServerFile, My.Settings.LocalFile, "username", "password", True, 1000, True)
the username and password supplied is correct. when i click on start-> run the ip address of the server, it pops up a username and password box. i enter in the exact same credentials and it goes through. what could be wrong or is there a better way of getting the file from the server onto a local pc thanks anoop
I'm assuming you're talking about grabbing the file from a Windows server. Try prefixing the domain to the username, "domainName\userName".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I'm assuming you're talking about grabbing the file from a Windows server. Try prefixing the domain to the username, "domainName\userName".
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hi, thanks for your help, i have tried that but still same outcome. is there perhaps another way of doing this i.e. coying a file from the server and providing username and password? thanks
-
Hi, thanks for your help, i have tried that but still same outcome. is there perhaps another way of doing this i.e. coying a file from the server and providing username and password? thanks
Uhh...you already are doing this. You've got the correct method, the trick is to use the correct "domain\username" and "password". If you're downloading a file from a Windows server or workstation, you need to understand how Windows networking works. If the server is in a domain environment, you need to use an account that the domain recognizes. If the server and workstation that you're code is running on are in different domains, then you need to specify the domain that the server will recognize, usually the same domain the server is in. Now, there's a catch. If you're logging the workstation in under one account and making connections to the server, you cannot use a seperate account to download the file form the same server. If the server is in a workgroup environment, then you may have to specify the name of the server as the domain part of the username.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008