tags:

views:

149

answers:

3

My client provides a network shared folder in the format of https://xxxx with user name and pwd. I need to write a console application to put a text file there. Is there any .Net class or library available? I prefer open source lib if available.

By the way, I can see the shared folder from Windows File Explorer: My Computer->My Network Places

A: 

You might want to take a look at

HTTP put - that's the first thing that came to mind. An example can be seen here::

http://www.java2s.com/Code/CSharp/Network/HTTPputwithusernameandpassword.htm

PSU_Kardi
It looks like to send a text stream to remote URL but it does not provide a file name on remote side. Correct me if I am wrong.
David.Chu.ca
A: 

it looks like it might be a webdav server. you can take a look at this question here if it helps: http://stackoverflow.com/questions/84088/open-source-library-in-c-to-communicate-with-a-webdav-server

Robert Ivanc
A: 

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.

mkoeller
how about to get file list from the url site? Is this possible?
David.Chu.ca
If that's equivalent to a HTTP GET on yyy.example.com then you just use "curl <URL>".
mkoeller