I need to post a text file to a remote PC. I know of one way which is to setup a ftp server on remote PC but i want to map a drive of remote PC to my computer and then post the file there using C#. In other words i want to know how can i share a folder on remote PC with my computer so i can post a file there using C#.
I want to know how network drive mapping is done
Here you can map any local drive for the remote session, and they will appear on the remote computer’s ‘My Computer’ when you connect.
UPDATE
You can simply have a network share configured on the remote machine, and your C# code can write to that folder.
Your path will look like
\\ComputerName\PublicShare\folder\structure\you\wantOr, you can have a fully blown client-server system, where you have a client running on the remote machine, connecting to the server instance on your machine, where your ‘server’ posts the contents of the file to the client through your API, and the client decides (using its configuration) where to write the file.
Which one to use, depends on your requirement. Network share is simple and easy to setup. Client-server system is a lot of code, but flexible enough to have a configuration, and security, and can be extended to allow file sharing over the internet.