Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8414329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:08:27+00:00 2026-06-10T01:08:27+00:00

I have following code: var listDirectoryFtpRequest = (FtpWebRequest) WebRequest.Create(directoryUri); listDirectoryFtpRequest.Method = WebRequestMethods.Ftp.ListDirectory; listDirectoryFtpRequest.Credentials =

  • 0

I have following code:

var listDirectoryFtpRequest = (FtpWebRequest) WebRequest.Create(directoryUri);
listDirectoryFtpRequest.Method = WebRequestMethods.Ftp.ListDirectory;
listDirectoryFtpRequest.Credentials = /* my credentials */;
listDirectoryFtpRequest.KeepAlive = false;
listDirectoryFtpRequest.UsePassive = true;
listDirectoryFtpRequest.UseBinary = true;

using (var response = listDirectoryFtpRequest.GetResponse())
{
    return true;
}

The directory, which is stored in directoryUri, does exist.

I have following log from my ftp-server

(022102) 30.05.2012 08:32:18 - **USER** (213.235.245.89)> 230 Logged on
(022102) 30.05.2012 08:32:19 - **USER** (213.235.245.89)> OPTS utf8 on
(022102) 30.05.2012 08:32:19 - **USER** (213.235.245.89)> 200 UTF8 mode enabled
(022102) 30.05.2012 08:32:20 - **USER** (213.235.245.89)> PWD
(022102) 30.05.2012 08:32:20 - **USER** (213.235.245.89)> 257 "/" is current directory.
(022102) 30.05.2012 08:32:21 - **USER** (213.235.245.89)> CWD /21792543/2/
(022102) 30.05.2012 08:32:21 - **USER** (213.235.245.89)> 250 CWD successful. "/21792543/2" is current directory.
(022102) 30.05.2012 08:32:22 - **USER** (213.235.245.89)> TYPE I
(022102) 30.05.2012 08:32:22 - **USER** (213.235.245.89)> 200 Type set to I
(022102) 30.05.2012 08:32:23 - **USER** (213.235.245.89)> PASV
(022102) 30.05.2012 08:32:23 - **USER** (213.235.245.89)> 227 Entering Passive Mode (10,40,31,10,229,112)
(022102) 30.05.2012 08:32:27 - **USER** (213.235.245.89)> NLST
(022102) 30.05.2012 08:32:27 - **USER** (213.235.245.89)> 150 Connection accepted
(022102) 30.05.2012 08:32:27 - **USER** (213.235.245.89)> 226 Transfer OK
(022102) 30.05.2012 08:32:29 - **USER** (213.235.245.89)> disconnected.

Nevertheless I get following exception:

System.Net.WebException: The underlying connection was closed: The server committed a protocol violation.
   at System.Net.FtpWebRequest.SyncRequestCallback(Object obj)
   at System.Net.FtpWebRequest.RequestCallback(Object obj)
   at System.Net.CommandStream.InvokeRequestCallback(Object obj)
   at System.Net.CommandStream.Abort(Exception e)
   at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage)
   at System.Net.FtpWebRequest.GetResponse()
   at **MYCLASS**.**MYMETHOD**

Why? … and how can I fix this?

PS.: I’ve found another question here on SO with similar symptoms. But do I really have to go for the KeepAlive = true-hack?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T01:08:29+00:00Added an answer on June 10, 2026 at 1:08 am

    Oh my dear … The .Net-implementation is not fixed until 3.5 – maybe it is by 4.0 …
    Anyway: I used System.Net.FtpClient to fix my uploading/downloading/requesting …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: var sl: THashedStringList; begin sl:= THashedStringList.Create; sl.Duplicates := dupIgnore;
I have the following code in my post action method for Edit. JobCardService.Update(viewData.JobCard); var
I have the following code: var wqry:TAdoQuery; ... FillChar(wSpaces,cSpacesAfter,' '); try wqry := TADOQuery.Create(nil);//here
I have the following code: var submitHandler = function ($link, $form, close) { var
I have the following code: var refreshId = setInterval(function() { $(#footad).html('myjshere'); }, 15500); Where
I have the following code: var carsContext = new CarsDataContext(); IQueryable<Car> allCars = carsContext.Cars;
I have the following code var dbvalue = Ned; var deleteLink = '<a href=#delete
I have the following code: var bool:String = true; Without an if block or
I have the following code: var GoalPanelView = Backbone.View.extend({ // Bind to the goal
I have the following code: var tlp = new TableLayoutPanel { Location = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.