views:

214

answers:

3

Hi,

I have a C# Windows Service that needs to access to a Linux computer to get a list of files in a particular directory. What .NET 3.5SP1 method would one use that allows me to do this?

Thanks.

+4  A: 

You'll have to create a Samba (SMB) or NFS share on the Linux box that is accessible from the Windows machine that is running your application.

You can then use the standard tools for working with files/directories in .NET to work with the files.

As mentioned in comments, you could also use the standard FTP libraries which would require configuring an FTP server on your Linux machine. SFTP is also an option...but would require a third party library on the .NET side.

Justin Niessner
S/FTP could also do this (assuming said linux machine is running one of these servers). FTP is built-in, SFTP would need a 3rd party library.
t_scho
S/FTP is not an option with the client.
Lenard
I just found this link: http://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share. (Don't know why my earlier searches didn't bring it up before.)
Lenard
+1  A: 

Hi you can check at my open source project http://code.google.com/p/nekodrive You can use directly NekoDrive.NFS c# library that wraps my implementation of V2 e V3 NFS Protocol (V4.1 is coming).. It doesn't support the full protocol yet but It works for basic browsing/download/upload functions..

hope this helps

mirko gatto