-2

I want to compress a file on a different machine using C#.

I want to know if that is possible with a C# windows application.

I want to search for that file on the other machine and I want to compress that file.

maazza
  • 7,016
  • 15
  • 63
  • 96
Sasuke Uchiha
  • 91
  • 1
  • 10
  • If you can access the file system then yes, of course it's possible. The application doesn't care where the file exists, as long as it's accessible. Did you try? – David Mar 03 '16 at 13:19
  • i don't know how to do that that's why i am asking. i am able to retrieve the list of files on the local system but i dont know how to do that on a LAN – Sasuke Uchiha Mar 03 '16 at 13:31
  • How does your computer itself access the files on the other computer? They have to be shared in some way. Start by making the files accessible, then whatever approach was used to make them accessible would be what the code would use to access them. – David Mar 03 '16 at 13:33
  • do you some free coffee with it too? show us what you tried.... – maazza Mar 03 '16 at 13:39

1 Answers1

0

You can, you would first need to share the directory that you would like to search, via an nfs share or samba share. Assuming it is a Windows machine see https://technet.microsoft.com/en-us/library/cc770880.aspx.

You can then access that file using a network location.

You can compress files using System.IO.Compression see https://msdn.microsoft.com/en-us/library/ms404280(v=vs.110).aspx

You can then use System.IO.Directory.GetFiles to search the directory for a file.