Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Copy file from another pc on network providing username and password [modified]

Copy file from another pc on network providing username and password [modified]

Scheduled Pinned Locked Moved Visual Basic
sysadminhelpquestioncsharp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anoop Brijmohun
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • A Anoop Brijmohun

      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

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      A 1 Reply Last reply
      0
      • D Dave Kreskowiak

        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

        A Offline
        A Offline
        Anoop Brijmohun
        wrote on last edited by
        #3

        Hi, 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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups