.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

FTPWebRequest - disabled server commands

Posted By:      Posted Date: October 25, 2010    Points: 0   Category :.NET Framework
I have been trying to use FTPWebRequest to send data files to an FTP server, however it keeps failing.  It seems to fail as FTPWebRequest will issue a 'PWD' and 'CWD' command.  The administrators have disabled these commands (their own right to do so), and as such, the MS classes will not allow me to use FTP.

I do not wish to use a third party, as that would mean that I need to distribute and maintain a thrid party dll (or similar) on multiple sites.

Can we disable the 'PWD' and 'CWD' commands?

View Complete Post

More Related Resource Links

FtpWebRequest - how to upload two files on FTP server using only one connection?

Hi I am using FtpWebRequest with option KeepAlive = true. When I upload first file I create ftp request object: FtpWebRequest result = (FtpWebRequest)FtpWebRequest.Create(""); I set KeepAlive = true and I do upload file. When I want upload second file I have to create new FtpWebRequest object using new URI FtpWebRequest result = (FtpWebRequest)FtpWebRequest.Create("");   I set KeepAlive = true and I do upload file. The problem is that I have to create new FtpWebRequest so I create new connection to FTP server (I have checked using netstat -b command that my application uses another port number for second file). How can I upload two files (or more) using only on FTP connection/session? Regards  

A FocusScope Nightmare (Bug?): Commands Are Disabled

I've got a simple menu with some simple commands:   Code Snippet <Menu> <MenuItem Header="Edit"> <MenuItem Command="ApplicationCommands.Cut" /> <MenuItem Command="ApplicationCommands.Copy" /> </MenuItem> </Menu>     I've got a simple control:   Code Snippet <UserControl x:Class="WpfApplication2.UserControlRed" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid /> </UserControl>     The code-behind for this control enables handling the 'Cut' command: Code Snippet   public partial class UserControlRed : UserControl { public UserControlRed() { InitializeComponent(); this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Cut, this.OnCut, this.OnAlwaysExecute)); } public void OnCut(object sender, RoutedEventArgs routedEventArgs) { Console.WriteLine("Cut"); } private void OnAlwaysExecute(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = true; } }     This control is added to a simple page so it can be navigated to using a Frame:   Code Snippet <!-- The Menu Commands are enabed with this code. --> <Page x:Class="WpfApplication2.PageRed" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x=&

SQL Server allowing access with NATIVE CLIENT Protocols are disabled.

I have disabled all client protocols from SQL Server Configuration Manager -> Sql Native Client configuration -> Client Protocols.Still I am able to access sql server with all client protocols disabled. Why ?Also I stopped the SQL Server Services and restarted it again. Then also the system is allowing me to connect with all the client protocol disabled.

Can WEBDAV be disabled in Sharepoint 2010 on a Windows Server 2008 R2?

Hello, we had some issues with WEBDAV use with Sharepoint 2010 placed behind WEBSeal proxies. We decided to only use FPSE (front page server extensions) for an external access to this portal. I cannot find a way, how to disable WEBDAV, or how to force clients to only use FPSE with this portal. It is fair, to say, that we would like to make such configuration on a server side, rather then configure client computers. We are running Sharepoint 2010 on a Windows Server 2008R2 server (i.e. IIS 7.5) thank you in advance for help/ideas Roman Cernovsky

Administrative Commands via XP_CmdShell in SQL Server 2005

SQL Server 2005: Microsoft SQL Server Enterprise Edition (64-bit) Microsoft Windows NT 5.2 (3790) SQL Version 9.00.3175.00   I have 2 identical servers... one for DEV and one for TEST. On the DEV server, I can use xp_cmsdhell to execute "administrative commands" such as NET SHARE and AT. On the identically configured TEST server, I can not. Those command return the "System error 5 has occurred. Access is denied" error. I CAN run other commands via xp_cmdshell (DIR, NET USE, etc.). This is true regardless of the account I connect as.   The SQL Server service accounts in both instances are domain accounts belonging to the local admin group.   I "know" that I ran across this when setting up the DEV server and am "fairly sure" I found a reference to a known problem with 2005's xp_cmdshell and administrative commands. But for the life of me I can not now find any such reference, nor can I find any differences between the DEV and TEST servers in the area of users, groups, policies, or anything else security-related. (99.9% of the internet searches I do end up being about either enabling xp_cmdshell -- done -- or setting up an xp_cmdshell proxy account -- not needed).   Any input is greatly appreciated.   Thanks! -dave

Did a dumb thing with Sql Server Loging IS / Offline / Single Integrated User / sa disabled [dumb?]

Have been using a single database (targetDb) outside of the master with Integrated Security Fairly new installation.... sa login is not enabled (?) Default database for my integrated ID is this "targetDb" And then took targetDb "offline", instead of Detaching during a machine swap process. No I can get in to the server/database, because the IntegratedWindowsLogin cannot login, because the tragetDb (default database) is offline.  sa cannot login, either - because is is not active. What do we do?  Travis McGee

Visual Studio Project Properties Customer Web Server option is Disabled


Hello All,

Can you please help me out to figure out the problem ?

I am not able to debug  ASP.Net applications on my localhost. What could be the reason.

When I checke project properties (for all my asp.net websites) i observered that the "Use Custom Web Server" option is disabled for all websites.

Any guesses what could be the reason. I am using Windows Xp SP 3 and have IIS installed on my computer. The issue was not there couple of days ago, but started creating problem since last night.


Thanks in advance.


FtpWebRequest GetResponse Error on Linux Server but work on Windows Server



I have a big problem when I tried to list directory from FTP Server on linux but using the FtpWebRequest.

An error occurs at the GetResponse() method but the same code work fine on Windows Server (IIS).

The error is :

The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
   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 FilePostman.Program.GetListFtp(NodeItem item)
   at FilePostman.Program.ReceiveFtp(NodeItem item)
   at FilePostman.Program.Main(String[] args)

The information that I use when run time like this:

Windows 2003

  Host :

  path : fmd/inbox

  uri :

  User : administrator

  Password : *******


FtpWebRequest - Access to IBM AS/400 FTP Server - 501 Character (/) not allowed in object name.

Hello everybody

I'm trying to communicate with an AS/400 FTP Server. As a first try I just execute the WebRequestMethods.Ftp.ListDirectory method, which translates to the NLST FTP command. Doing the same accessing a Microsoft FTP Server or a UNIX FTP Server works fin.

This is the code to get the listing:

Dim Uri As System.Uri = New System.Uri(listUrl)
Dim listRequest As FtpWebRequest = CType(WebRequest.Create(Uri), FtpWebRequest)
listRequest.Credentials = New System.Net.NetworkCredential(User, Password)listRequest.Method = WebRequestMethods.Ftp.ListDirectory
listRequest.KeepAlive =
listRequest.UseBinary =

FtpWebRequest and custom commands

How can i send custom command through an FtpWebRequest?

I tried with this but it doesn't work :(

using System;

using System.Collections.Generic;

using System.Text;

using System.Net;

using System.Net.Sockets;

using System.IO;

namespace ftpProva


class Program



Sql Server Database services option in components install is disabled during installation of SQL Ser


OS: Windows Vista

SQL :2005

While selecting components to install during installation of SQL Server 2005 on Windows Vista

1)Sql server database services ,create a sql server failover cluster

2)Analysis services

3)reporting Services are disabled mode.

please tell me how to enabled this  options during installation.

FtpWebRequest GetResponse throw The server committed a protocol violation :(



I have some trouble with FtpWebRequest class.

I use it for connection to two ftp servers

The first server is working perfectly, but when i use the same programm to connect to another one the "The underlying connection was closed: The server committed a protocol violation." exception is thrown when I call GetResponse method.

I found only one difference between servers.

The first server returns:

  • 220 Hello k-net ftp server

The second FTP return the same banner but ON RUSSIAN Lang!!!

  • 220 ?????? ?? ???! ?????????!

Is any UseUnsafeHeaderParsing property exists for FTPWebRequest, like for HTTP?

P.S> I'am not using SSL!

The sources is here:


FtpWebRequest listRequest =


listRequest.UsePassive = false; //true

listRequest.Method = WebRequestMethods.

SQL Server 2008 R2 'commands summary guide'


Is there some place a 'chart/guide' of the 'SQL Server 2008 R2 commands organized by groups? A summary of all those commands used to manage and administer SQL Server 2008 R2 with their attributes and a brief description of the task being preformed?

Maybe an O'Reilly book, pocket guide kind of thing. This is of course, a Microsoft only guide to MySQL.

call JavaScript - jQuery code from ASP.NET Server-Side

jQuery got so close to me lately that I can see myself adding the scripts to my project almost unconsciously. The thing is, jQuery is very useful for me, in almost all situations and it has been a do or die enhancement for all my project since I first put my hands on it.

Of course while using it, you encounter few situations which need a bit of research to solve, mostly when you are trying to combine it with some other technologies like: UpdatePanels and ASP.NET Ajax. For instance there are many situations when I would like to run some jQuery magic based on some decision that I make on the server side.

Making Ajax Callbacks to the Server Using jQuery with ASP.NET

In the first part of this article series I introduced jQuery's functionality and how it provides a rich client side programming model. This time around I'll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I'll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.

jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend