简体   繁体   中英

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?

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, eg File.Copy(..."\\\\clientPC\\c$\\yourfile.txt") to send file.

You can use the class posted here for UNC authentication .

Is this in the same domain as your machine? If so, do you have the ability to create a share? If you can, you may be able to just setup a share and transfer the files as you would locally. If this is possible there is no point in creating a verbose application for a trivial need.

I built similar for a company I used to work for, the "client" exposed a share and me; the "server" simply used File.Move() to transfer files.

是的,您可以使用模拟, 阅读本文 ,也许会有所帮助。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM