Search code examples
c#visual-studio-2010filenetwork-programminglan

Sending file in lan without a client/server solution


I working on a windows forms project, visual studio 2010, c#

I want to send some files to computers in our network but they don't have a "listener" as in client/server solution but i do have username/password. Is there any way to send files knowing this information? And as i said, i do not want to build a client / server solution.

Cant i use "Impersonate" somehow?


Solution

  • If you know the username password and your client is within the same domain, you might be able to use UNC with authentication (with $) and send the files to client PC. Something like: \\clientPC\c$. Once authenticated, you can just use File IO, e.g. File.Copy(..."\\clientPC\c$\yourfile.txt") to send file.

    You can use the class posted here for UNC authentication.