Copy file from another pc on network providing username and password [modified]
-
Hi guys this is my scenario i have a shared folder on the server with an exe file in it. i have a program on the clients pc. when this app launches i want the app to copy the server file and overwrite the client one everytime. problem is that sometimes the client pc prompts for a username and password to the server, how do i get around this? this is what i have done thus far, but wud like to know if there is another better method.
Dim credentials As Net.NetworkCredential
credentials = New Net.NetworkCredential("username", "password")
Dim DestFile As Uri = New Uri("c:\programs\addons.exe")
Dim FileToCopy As String = "\\196.96.9.5\cd\addons.exe"
my.Computer.Network.DownloadFile(fieltocopy,destfile,username,password,True ,1000,True ,FileIO.UICancelOption.ThrowException )thanks for your help
modified on Thursday, March 19, 2009 10:25 AM
-
Hi guys this is my scenario i have a shared folder on the server with an exe file in it. i have a program on the clients pc. when this app launches i want the app to copy the server file and overwrite the client one everytime. problem is that sometimes the client pc prompts for a username and password to the server, how do i get around this? this is what i have done thus far, but wud like to know if there is another better method.
Dim credentials As Net.NetworkCredential
credentials = New Net.NetworkCredential("username", "password")
Dim DestFile As Uri = New Uri("c:\programs\addons.exe")
Dim FileToCopy As String = "\\196.96.9.5\cd\addons.exe"
my.Computer.Network.DownloadFile(fieltocopy,destfile,username,password,True ,1000,True ,FileIO.UICancelOption.ThrowException )thanks for your help
modified on Thursday, March 19, 2009 10:25 AM
UploadFile?? Is this code running on the server or running on the client machine???
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
UploadFile?? Is this code running on the server or running on the client machine???
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Hi, this code runs on the client. it should be using my.Computer.Network.DownloadFile(fieltocopy,destfile,username,password,True ,1000,True ,FileIO.UICancelOption.ThrowException ) thanks