如何打开具有用户名和密码的FTP文件夹? [英] How to open FTP folder having User name and password?

查看:130
本文介绍了如何打开具有用户名和密码的FTP文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在FTP中,我有用户名和密码.用户名-user585密码-pwd123
和FTP站点 ftp://fp.server.com/myfolder/images/

我的代码是,

In FTP I have user name and password . username- user585 password - pwd123
and FTP site ftp://fp.server.com/myfolder/images/

My code is ,

private void ImageButton_Click(object sender, EventArgs e)
{
this.Cursor = Cursors.WaitCursor;
Process commonImageFolder = new Process();
commonImageFolder .StartInfo.FileName = "ftp://fp.server.com/myfolder/images/"
commonImageFolder.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
commonImageFolder.Start();
commonImageFolder.Close();
this.Cursor = Cursors.Default;
}



如果我每个人都单击imagebutton,则要求输入用户名和密码.
如何以编程方式提供凭据?

请帮帮我
在此先感谢.



If i click imagebutton each and every tim it is asking for user name and password.
How to give the credentials in programmatically ?

Please help me
Thanks in Advance.

推荐答案

甚至没有关闭.

您需要使用类System.Net.FtpWebRequest,请参见 http://msdn.microsoft.com /en-us/library/system.net.ftpwebrequest.aspx [ ^ ].

此示例显示如何获取目录列表: http://msdn.microsoft.com/zh-cn/library /ms229716.aspx [ ^ ].

有关更改目录的信息,请参见以下讨论:
http://social.msdn.microsoft.com/forums /en/netfxnetcom/thread/76d3a3a2-48b6-4753-988e-dfd845f582e9/ [
Not even close.

You need to use the class System.Net.FtpWebRequest, see http://msdn.microsoft.com/en-us/library/system.net.ftpwebrequest.aspx[^].

This example shows how to get directory list: http://msdn.microsoft.com/en-us/library/ms229716.aspx[^].

For changing directory, see also this discussion:
http://social.msdn.microsoft.com/forums/en/netfxnetcom/thread/76d3a3a2-48b6-4753-988e-dfd845f582e9/[^].

—SA


这篇关于如何打开具有用户名和密码的FTP文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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