我的客户端提供了一个格式为https://xxxx的网络共享文件夹,其中包含用户名和密码。我需要编写一个控制台应用程序来将文本文件放在那里。是否有可用的 .Net 类或库?如果可用,我更喜欢开源库。
顺便说一句,我可以从 Windows 文件资源管理器中看到共享文件夹:我的电脑->我的网上邻居
我的客户端提供了一个格式为https://xxxx的网络共享文件夹,其中包含用户名和密码。我需要编写一个控制台应用程序来将文本文件放在那里。是否有可用的 .Net 类或库?如果可用,我更喜欢开源库。
顺便说一句,我可以从 Windows 文件资源管理器中看到共享文件夹:我的电脑->我的网上邻居
你可能想看看
HTTP put - 这是首先想到的。可以在这里看到一个例子::
http://www.java2s.com/Code/CSharp/Network/HTTPputwithusernameandpassword.htm
看起来它可能是一个 webdav 服务器。如果有帮助,您可以在此处查看此问题:Open source library in c# to communication with a WebDAV server
You need a command line tool to POST a file to some URL, right? What about
>curl --data-binary /usr/xzy/testfile -u user:passwd https://xxx
In essence curl is a tool that allows to reproduce literally any HTTP request that you might possibly need to send. However, it's a unix/linux tool and you might need cygwin to run it on a Windows machine.
On a linux environment your task might be reduced to writing a UI that triggers curl as external command.
If for nothing else, curl might be a great debugging/testing tool for your developement.