Getting an error while trying to get the list directories present in FTP server

Please anyone help me out with this problem;

Actually when i trying to get list of directories from ftp server m getting error as "The remote server returned an error: (550) File unavailable (e.g., file not found, no access). "

Here is my code: Am calling this method from page load;

public void GetDirectories(string strProduct)

{

 

StringBuilder strBuilder = new StringBuilder();

 

#region"FTP - List Directories"

try

{

string ftpServerIP = "ftpserverurl" or Ip address

FtpWebRequest ftpReq;

ftpReq = (FtpWebRequest)FtpWebRequest.Create(new Uri("ftp://" + ftpServerIP + "/Documentation/Support/" + strProduct));

ftpReq.Credentials = new NetworkCredential("username", "password");

ftpReq.KeepAlive = false;

ftpReq.UseBinary = true;

ftpReq.Method = WebRequestMethods.Ftp.ListDirectory;

WebResponse response = ftpReq.GetResponse();

StreamReader reader;

string strLine;

reader = new StreamReader(response.GetResponseStream());

strLine = reader.ReadLine();

 

// string strLine = reader.ReadLine();

while (strLine != null)

{

strBuilder.Append(strLine);

strBuilder.Append(
"\n");

strLine = reader.ReadLine();

}

MessageBox.Show(strBuilder.ToString());

}

catch (WebException e)

{

String status = ((FtpWebResponse)e.Response).StatusDescription;

}

 

#endregion

}

 

Your help will be appreciated :)


Nagaraj S K
Asp.Net and Java Developer
Bangaluru
0
nagarajec
10/30/2008 5:46:59 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
990 Views

Similar Articles

[PageSpeed] 33

Hi nagarajec,

Sorry, I am not familiar with this field.  After search, I found an thread has solved this problem, you can refer it,

http://forums.asp.net/p/1306713/2613116.aspx 

 


Hong-Gang Chen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
0
Hong
11/4/2008 8:53:20 AM
Reply:

Similar Artilces:

Get ftp directory list from ftp server
Hi Firstly Thanks for any help that is given. What I want to do is using a web service connected to an FTP server using a Auth TLS connection and generate a full ftp directory listing. Is This Possible ?? Regards ...

Unable to get the project file from the web server
Hello, I had the Commerce kit installed on my machine and working for a while. After uninstalling it using Add and Remove program, I installed it again and now the solution would not open in Visual Studio .net. I get an error saying "Unable to get the project file from the web server" Anyone know what is happening and how I can fix this? Other project that I have on my machine are opening fine. Anyone else have this problem? I cant get it to work, today I re-installed VS.net but am having the same problem. I even tried installing into a different folder but no ...

trying to get started and i am getting this error
when i go to http://www.porkchopsplayground.com, i get: DotNetNuke Upgrade Error The Assembly Version ( [ASSEMBLYVERSION] ) does not match the Database Version ( [DATABASEVERSION] ) ERROR: Could not connect to database. Could not find file 'd:\hosting\nmoran26\Providers\DataProviders\AccessDataProvider\DotNetNuke.mdb'. Any suggestions will be appreciated. Thanks, Nicole Do you have a username and password set on your database? Make sure you follow the steps mentionned in the Readme.txt located in the documentation folder. In any case make sure your credentials for yo...

I need help with this issue. I am running server 2003 and I am trying to access to my web to make some changes and I get this error
Error(s): System.UnauthorizedAccessException: Access to the path "C:\inetpub\wwwroot\xml\exceptions.xml" is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String str) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean useAsync, String msgPath, Boolean bFromProxy) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) at System.Xml.XmlDocument.Save(String filename) at QWebManager.Common.Errors(Exception Ex) alexmiami--This sort of thing... alexmiami wrote:...System.Unau...

Getting path denied error when trying to run copied .NET 1.1 project to new server
I am having a problem getting a project started on one server transferred to another.  USS folder does not exist. Entire Solution and Project Files were copied onto server. Know I am missing something here. Thanks.   Server Error in '/USS' Application. Access to the path "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\uss\7cb89631\ffe5ea77" is denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the cod...

I can't get no cache, I can't get no cache. 'Cause I try and I try and I try and, I can't get no, I can't get no cache.
I have fiddled out for days tinkering with the setting in about:config trying to get FireFox 12 to use the disk cache. I have NOT found the trick. This One Trick Pony ain't doing it like it used to up until recently. Pray tell anyone, What information can I share that will point a knowledgeable person to aid me in getting FF to disk.cache? I have also tried restarting FF with add-ons disabled, (There were NOT too many to do this to, so it was quick and easy) Here is my stab at trying to convey the information that MIGHT govern matters Using about:cache Informatio...

Getting error in Net::SFTP with get function
------=_Part_7028_3315294.1193837808284 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi All, I have the following code as part of my program; print "---=========> $file, $localFile\n"; $sftp -> get( $file, $localFile ) || warn("errrrr0rrrrr _---> $!".$sftp->status."\n");^M Even though it has downloaded the file properly, it is giving the following message: ---=========> /trading/tiscrdenhlist10310000.txt.old, /export/home/crdadm/rajeev/tiscrdenhlist103...

Getting password error when trying to get mail.
Hi, my problem is that when I logon to Thunderbird & it immediately logons to the relevant POP3 server it throws back an alert that 'Sending the password did not succeed. Mail server MAIL1.eircom.net responded: invalid ray o'sullivan'. I have contacted the support people for the eircom server mentioned above and confirmed that the password I was using was/is correct. I have been using Thunderbird for 2 to 3 years with no issues even when I went to broadband. Any clues to a resolution would certainly be appreciated as I am a daily user. Thanks, Ray. ...

VS.NET 2005 is ignoring in web.config strict="true". I get no error when I try this: Dim x As Integer = "string"
Hello,I have this in my VS.NET 2005 web.config <compilation debug="true" strict="true" explicit="true">When I do this in my vb code:Dim x As Integer = "string"I get no error. When I hit compilation I also get no error. What am I doing wrong?Thanks for helping!Regards,J. Bauer It's a bug of some sort See this response by Scott Guthriehttp://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3c1c9898-8076-4f69-a5e2-e99573d03c6e Unfortunately we don’t have a GUI based way to configure this. L It is something we will make sure gets added back in, though, with the next...

Re: I can't get no cache, I can't get no cache. ' Cause I try and I try and I try and, I can't get no, I can't get no cache.
<div>please com e see me about htis<br /> <br /> ------- Original Message f= rom the Global Relay Archive -------<br /> From: Hp &lt;ferd@farkel.net&gt;= <br /> To: "support-firefox@lists.mozilla.org" &lt;support-firefox@lists.mo= zilla.org&gt;<br /> Sent: Sun, 27 May 2012 18:30:18 -0700<br /> Subject: I = can't get no cache, I can't get no cache. 'Cause I try and I try and I try = and, I can't get no, I can't get no cache.<br /> <br /></div> <pre class=3D"gr-maex-body-pre&qu...

Trying to transfer a Web Service made in .NET aspx on my "localhost", to online and getting BC30002: Type 'localhost.Convert' is not defined. error
I think I get the general idea of this error.  The webservice works on my computer as Visual Web Developer somehow makes a temporary server out of my computer.  But when I try to FTP my full ASP page I get an error that localhost is not defined.  This makes sense as I am sure the web server for GoDaddy is not called localhost for me.  Now in my App_WebReferences folder in my program I have a local host folder that holds 3 automatically generated files which are somehow "calls" to a webservice that I built.  So I have the original files for the webservi...

How can I get a directory listing of the server's current directory
Dear all, Using the Net::FTP, how can I get a directory listing of the server's current directory ? ftp->ls() methode does not return a directory listing, just ARRAY.. Thanks a lot. -shahn Please ask your question on a general perl list. This list only answers DBI related questions. Thank you Reinke ----- Original Message ----- From: "shahn" <shahn@asekr.com> To: <dbi-users@perl.org> Sent: Thursday, May 31, 2001 12:48 PM Subject: How can I get a directory listing of the server's current directory > Dear all, > ...

Accessing the Enterprise Web Server through WebAccess I get and Internal Server Error
Accessing Web Access on port 2200 The Link in Web Access to our NetWare Enterprise Web Server comes up With an Internal Server Error. I hate it when it tells me to Contact the Server Administrator when I'm the Server Administrator. The first line is The server encountered an internal error or misconfiguration and was unable to complete your request. While upgrading this server to NetWare6 it warned me that it was running Enterprise Web Server so I went back and check the box to upgrade the Enterprise Web Server Software which it did. Looking at the autoexec.ncf ...

I created a website on my localhost with three .mdf files using SQL express but now I get an error when I try to host it on my web server without SQL express. need some help on how to change my connec
An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.SqlClient.SqlException: An error has occurred whil...

Web resources about - Getting an error while trying to get the list directories present in FTP server - asp.net.web-forms

Avicenna Directories - Wikipedia, the free encyclopedia
Between 2000-2007, the WHO published the directory electronically, along with updates received after the 2000 print publication. In August 2007, ...

To Complement Its Search Engine, Facebook Launches People, Pages, and Places Directories
Facebook is now closer than ever to becoming the phone book for the internet. The site recently launched a Directory of people , Pages , and ...

Directories
The source for IT industry news, views and analysis across the channel, business and technology

Princess Diana leaked royal directories to Murdoch tabloid, court hears
The former royal editor of Rupert Murdoch's now defunct British tabloid the News of the World told a court on Thursday that the late Princess ...

Telstra slashes 800 jobs from directories arm Sensis
TELSTRA is slashing 800 jobs from its struggling directories arm Sensis just one month after the telco giant sold a 70 per cent stake in the ...

Government To Stop Publishing Contact Information In Blue Pages Of Phone Directories
... has decided to stop publishing contact information for all of its departments and agencies in the blue pages section of telephone directories.A ...

File System Programming Guide: Accessing Files and Directories
Explains how to create and manage files and directories.

Fixing directories
Web directories are one of the key points of differentiation between plans on the Exchanges. A single company can offer half a dozen networks ...

Welcome to SBJ Local Directories
... newsletters, events, print subscription, digital subscription or other special offers. Welcome to Sacramento Business Journal's local directories. ...

Bradenton and Lakewood Ranch Guides - Directories and guides
The Bradenton Herald is your source for Bradenton and Lakewood Ranch directories and guides.

Resources last updated: 1/17/2016 1:52:11 PM