从C#访问UNIX文件 [英] Accessing UNIX file from C#
本文介绍了从C#访问UNIX文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从一个dotnet应用程序中读取我在UNIX服务器上创建的文本文件。
我正在使用
Hi,
I want to read a text file that I've created on UNIX server from a dotnet application.
I'm using
WebRequestMethods.Http.Get
要阅读,但我不确定如何提供物理路径...目前我只是在使用:
to read but I'm not sure how to provide the physical path...currently I'm just using:
FileWebRequest request = CreateHttpWebRequest(Path.Combine(@"//", "server/folder/"), "userName", "password", true);
我收到网络未找到错误。
请咨询。
谢谢。
I'm getting a network not found error.
Please advice.
Thanks.
推荐答案
就个人而言,我根本不会使用HTTP,我会使用FTP(毕竟这就是它的意思)
要么通过 FtpWebRequest类 [ ^ ]或通过库:< a href =http://www.codeproject.com/Tips/4 43588 / Simple-Csharp-FTP-Class>简单的C#FTP类 [ ^ ]
Personally, I woudln't use HTTP at all, I'd use FTP (that is what it's meant for, after all)
Either via the FtpWebRequest class[^] or via a library: Simple C# FTP Class[^]
这篇关于从C#访问UNIX文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文