如何从网络共享路径复制文件 [英] How to copy files from network shared path

查看:506
本文介绍了如何从网络共享路径复制文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在HTTPS网站下有一个共享路径,该路径只能由授权人员访问.该路径受Internet Security and Acceleration Server 2006保护.
我有自己的ID和密码,只能通过浏览器访问该路径中的文件.

现在,我所需要做的就是学习如何使用我拥有的所有详细信息,并将其放入C#Web应用程序中,以便可以使用这些文件查看页面中的详细信息.

我在使用路径和身份验证凭据时遇到了麻烦,因为我不知道在应用程序中如何以及在何处提及它们.因此,这是一个HTTPS网站链接,在该链接下,我可以访问一个共享文件夹,但只有在输入ID和密码后才能访问该文件夹.

示例路径名:https://mysample.example.com/SharedStoragePath/

我是一个初学者,所以请原谅我的错.如果文件已经由某些HTTP服务器提供服务,则需要使用某些客户端访问该文件.通常,您只能下载文件.只有在服务器支持的情况下才可以上传.通常,它提供一些带有Web表单的HTML页面或一个特殊控件,其中HTTP请求是使用Ajax完成的.

实际上,HTTP和HTTPS之间的区别在于您需要在同一客户端的会话中通过身份验证.

现在,不清楚您是需要服务器端还是客户端需要一些代码;原则上,您可以同时进行.最常见的问题是关于客户端的.基本上,您可以使用类System.Net.HttpWebRequest(对于HTTP和HTTPS)进行所有操作.请参阅:
http://msdn.microsoft.com/en-us/library/system.net. webrequest.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.net. httpwebrequest.aspx [ ^ ].

—SA


我建​​议创建一个您与之通信的服务来传输文件.我相信由于防火墙问题,您将无法从WebService进行任何操作.


I have a shared path under a HTTPS website which can only be accessed by authorized people. The path is protected by Internet Security and Acceleration Server 2006.
I have my own ID and password to access the files in that path but only through the browser.

Now all I need is to learn how to use all the details that I have, to be put in a C# web application so that I can use those files to view details in my page.

I have trouble with the path and the authentication credentials, as I don''t know how and where to mention them in the application. As such it is a HTTPS website link, under which I have a shared folder to which I have access but only when I enter my ID and password.

Sample path name: https://mysample.example.com/SharedStoragePath/

I''m a beginner, so kindly excuse my faults if any.

解决方案

Please see my comment to the question, where I explain why it is not valid. If your files are already served up by some HTTP server, you need to access to the file using some client side. Generally, you can only download files. Uploading is only possible if the server supports it; usually it provides some HTML page with a Web form or a special control where the HTTP requests are done using Ajax.

Practically, the difference between HTTP and HTTPS is that you need to pass authentication in the same client''s session.

Now, it''s not clear if you need some code on server side or on client side; in principle, you can do both. Most usual questions are about the client side. Basically, you can do everything using the class System.Net.HttpWebRequest (for both HTTP and HTTPS). Please see:
http://msdn.microsoft.com/en-us/library/system.net.webrequest.aspx[^],
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx[^].

—SA


I would recommend creating a service that you communicate to for transfering the files. I beleive that you are going to have trouble doing anything from the WebService because of firewall issues.


这篇关于如何从网络共享路径复制文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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