Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello all,

I need to read file from linux computer from windows computer with c#.

Would you please guide me right way.
Posted
Comments
Dr.Walt Fair, PE 17-Sep-11 0:04am    
Can you access the linux computer over a network? Can you even see the file system from Windows?
mmdullah 17-Sep-11 0:56am    
So far I know, you can send FTP command with valid user credentials to read file attribute of linux files from windows.
The user must have read permission.
I need to know the mechanism. Would you please suggest me other ways, if possible?

1 solution

On Linux, you have a choice of several different FTP servers; each of the servers providing its own ways to configure anonymous access to some part of the server's file system. Usually, FTP servers provide access to different directories on server's file system on per-user basis, and the anonymous user can be treated as one of the users. You need to perform the search for Linux or Unix FTP servers and learn about features of each.

Using C# code as a FTP client can be based on the class System.Net.FtpWebRequest; you will find some code samples here: http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].

One completely different approach could be installing Mono on Linux and developing some custom application with file sharing. Mono is cross-platform implementation if CLR, its compatibility with .NET is wonderful. I use it for solving most tricky problems of cross-platform applications. See http://en.wikipedia.org/wiki/Mono_%28software%29[^], http://www.mono-project.com/[^]. The code developed on Windows can be run under Mono on Linux and other platforms (even most tricky Mac OS X) without recompilation.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900