在c#中使用另一台机器访问放置在一台机器上的文件 [英] Access the files placed on one machine with another in c#

查看:95
本文介绍了在c#中使用另一台机器访问放置在一台机器上的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我有一个任务,访问服务器1上的文件并以var二进制格式插入表格。



假设我有一个特定文件夹的路径包含文本文件,服务器1的IP地址也有服务器1的凭据。

现在我必须制作一个程序将在服务器1上点击并获取放置在该路径上的所有文件并以var二进制格式插入附件表。



所以你能告诉我什么是最好的执行上述任务的方法,请在c#中提供一个小样本。



提前致谢。

解决方案

< blockquote>为什么要标记你的帖子FTP?你真的需要FTP吗?



如果你有服务器的凭据,你有两个选择



a )在您需要的文件所在的服务器上创建一个永久共享,然后创建一个永久地图到您工作机器上的驱动器



b)几乎按照(a) ),但在需要时将驱动器映射到服务器/共享 - 忘记后面链接中基于表单的示例,查看示例代码 - 您可以动态创建和删除共享http://www.codeguru.com/csharp/csharp/cs_network /windowsservices/article.php/c12357/C-Map-Network-Drive-API.htm [ ^ ]



至于最好的方法 - 如果你在内部网络上服务器是稳定的,两个选项都很好


Hi All,

I have a task in which access the files on server 1 and insert in table in var binary format.

suppose i have a path of particular folder contain text file with IP address of server 1 also have the credentials of server 1.
Now i have to make a program which will be hit on server 1 and fetches all file placed on that path and insert into attachment table in var binary format.

so will you please tell me what is the best method to do the above task, please provide a small sample in c#.

Thanks in advance.

解决方案

Why have you tagged your post FTP ? do you really need FTP ?

If you have credentials for the server, you have two options

a) create a permanent share on the server where the files you need are located, then create a permanent map to a drive on your work machine

b) almost as per (a), but map a drive to the server/share when you need it - forget the forms based sample in the link that follows, look at the example code - you can create and take-down a share dynamically http://www.codeguru.com/csharp/csharp/cs_network/windowsservices/article.php/c12357/C-Map-Network-Drive-API.htm[^]

as for the 'best method' - if you're on an internal network and the server is 'stable', either options is good


这篇关于在c#中使用另一台机器访问放置在一台机器上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆