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


Top 5 Contributors of the Month
david stephan
Santhakumar Munuswamy
Asad Ali
Fauzul Azmi
Post New Web Links

FtpWebRequest GetResponse().GetResponseStream() method not works during VPN connection

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :.NET Framework
 

Hi,

One of my client is providing FTP Acess over VPN Connection.
Whenever i try to use FtpWebRequest object.GetResponse().GetResponseStream() throws error message "fil not found,no acess,..."something like that.
But if try using explorer it lists the files and directories.


I found the "Proxy" property is available for FtpWebRequest object.
can anyone help how to use this Proxy property or is there any other way to connect FTP to list a file using c#.

What is the difference between using WebRequestMethods.Ftp.ListDirectoryDetails in c# and exploring files through windows explorer .

 

Is there any way to list the files of ftp using VPN connection. I connected the VPN manually. But i want to connect only FTP through C#.




View Complete Post


More Related Resource Links

FtpWebRequest GetResponse().GetResponseStream() method not works during VPN connection

  

Hi,

One of my client is providing FTP Acess over VPN Connection.
Whenever i try to use FtpWebRequest object.GetResponse().GetResponseStream() throws error message "fil not found,no acess,..."something like that.
But if try using explorer it lists the files and directories.


I found the "Proxy" property is available for FtpWebRequest object.
can anyone help how to use this Proxy property or is there any other way to connect FTP to list a file using c#.

What is the difference between using WebRequestMethods.Ftp.ListDirectoryDetails in c# and exploring files through windows explorer .

 

Is there any way to list the files of ftp using VPN connection. I connected the VPN manually. But i want to connect only FTP through C#.


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("ftp://10.10.6.104/lcsroot//inpt//Test//file1.xml"); 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("ftp://10.10.6.104/lcsroot//inpt//Test//file2.xml");   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  

Open method works with one app, crashes with another

  
Fairly straightforward. I do:         public static SqlConnection DBConnection;             try             {                 string sqlConnection = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;                 DBConnection = new SqlConnection(sqlConnection);                 DBConnection.Open();             }             catch (Exception ex)             {                 MessageBox.Show("Error starting application: " + ex.Message + Environment.NewLine + ex.InnerException.Message);             } In one app, this works fine. In another, which uses the exact same code copied to the app that works this throws up the old "<app> has encountered a problem and needs to close" dialog. The Connection object is not null and I've narrowed it down to the Open method line. I'm stymied as to why this is happening. First, why is the problem not being caught? Second, the "What data does this erro

SqlClient Connection Works Fine with XP, will not work on Windows 7

  

Hello, I am programming in VS2010 wirting a simple windows forms program. I am using the System.data.SqlClient for a connection. My data Connection code:

'Used for reading data only

 

 

Public Function O

FtpWebRequest GetResponse Error on Linux Server but work on Windows Server

  

Hi,

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 : ftp://10.10.30.19

  path : fmd/inbox

  uri : ftp://10.10.30.19/fmd/inbox

  User : administrator

  Password : *******

LINUX :

Invoking a web method fails with 'The underlying connection was closed: Unable to connect to the re

  

Hi all,

i am currently challenging a problem that suddenly started to happen in my production environment when invoking a WS method from a windows-service .NET app.

The windows service is waiting for requests incoming through MQ, unwraps these requests from an "MQ XML packet" and redirects these requests to the web service. This web service has only one web method, which is kind of "main entry point" for the underlying backend application.

This monday approx. 30% of attempts to invoke that web method are failing with message: The underlying connection was closed: Unable to connect to the remote server.   
      CallStack:   
      at System.Net.HttpWebRequest.CheckFinalStatus()   
      at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)   
      at System.Net.HttpWebRequest.GetRequestStream()   
      at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object?! parameters)   
      at MyWebService.GetResponse(String requestMessage, String&amp; responseMessage)   
 &n

Persistent FTP connection using FtpWebRequest

  

Hi all,

Is it possible to have a persistent FTP connection using FtpWebRequest? So far what I have found is that every time I want to upload/download from a FTP server I open a new FtpWebRequest connection using my credentials. Instead of creating new FtpWebRequest every time is it possible to use the same connection? I want to upload/download a series of files from the server one after another in this fashion.

Also I didn't find any option to implement MPUT/MGET in FtpWebRequest. Any suggestion on how to implement such things is welcome.

Thanks in advance.


ODBC remote internet connection: works Win 7, but doesnt on Win XP

  

Hi, I have a SQL Server 2008 express running well. The connections in the local network runs very well via ODBC Native Client 10.0 .

When I try to connect via internet, it works when I configure the ODBC in my notebook that has a Win 7, but when I try to go to other computer in the same network with Win XP, it says "Connection timeout".

I had to download de ODBC Native Client 10.0 for the WinXP pcs, because the standard "SQL Server" ODBC driver was not working...

 

Anyone has an idea?

 

Tks!

 

Guilherme Louzada


The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with e

  

I have deployed my packages into Sql Server and I am using Configuration File. As my Data Source is Excel, I have changed the connection string during deployment with Server Path. But I am getting the following errors. Actually the File Exist in Path. May I know What is cause of the issue? Do I need to give any permission to execute the package.

 

SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed. 

 

component "Excel Source Service Contract Upload" (1) failed validation and returned error code 0xC020801C. 

One or more component failed validation. 

 

There were errors during task validation. 

DTS_E_OLEDBERROR, Error Code: 0x80004005 Source: "MS JET DB Engine" Description : Path is not valid


 


The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with e

  

Hi,

I am running package from my local system through Visual studio, It is running perfectly, even I created job and ran the job it is running fine

but when I have deployed my packages into production Sql Server and I am using Configuration File & running package from Job. As my Data Source is Excel, I have changed the connection string during deployment with Server Path. But I am getting the following errors. Actually the File Exist in Path. May I know What is cause of the issue? Do I need to give any permission to execute the package.

"[EXL SRC [1]] Error: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection method call to the connection manager "Excel Connection Manager_PAM" failed with error code 0xC0202009.  There may be error messages posted before this with more information on why the AcquireConnection method call failed."

Component "Excel Source Service Contract Upload" (1) failed validation and returned error code 0xC020801C. 

One or more component failed validation.

I got this ans which is applicable when running package from Visual Studio.

Ans when running from Visual Studio:

Go to Project Properties->Configuration properties-&g

FtpWebRequest GetResponse throw The server committed a protocol violation :(

  

Hello.

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 =

(FtpWebRequest)WebRequest.Create(listUrl);

listRequest.UsePassive = false; //true

listRequest.Method = WebRequestMethods.

Thinking about new C# method prototypes: object as dictionary

  
I recently had to write a small Flickr API. I know many .Net API for Flickr already exist but I needed one for a Silverlight application. Whatever, it's only about building some querystrings so I did it by myself. It's been an opportunity to think again about a classical question: how to pass parameters to a method ?

Imagine you have a generic method to call some Flickr functions.

SQL Connection String

  
We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners!

abstract away the source of the connection string using a class with a static property.

  
ASP.NET provides a configuration system we can use to keep our applications flexible at runtime. In this article we will examine some tips and best practices for using the configuration system for the best results.

The element of a web.config file is a place to store connection strings, server names, file paths, and other miscellaneous settings needed by an application to perform work. The items inside appSettings are items that need to be configurable depending upon the environment, for instance, any database connection strings will change as you move your application from a testing and staging server into production.

Encapsulation
Let's abstract away the source of the connection string using a class with a static property.

Code works on aspx but not ascx

  

Not sure which category to put this question in, so I will put it in here.

Just to give you an idea of the layout of my solution, I have the main project, along with 2 class libraries, BLL and DAL.  (Business Logic Layer and Data Access Layer)

The BLL refers to the DAL and the main project refers to the BLL.


I had a test website and the code worked fine, but the same code will not work on the real project. The only difference is that in the test project, the code was on an aspx code behind, whereas in the real project, it is an ascx code behind (Web User Control )

The code is:

Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString
        Dim recordEntry As New UserRecord(connectionString)
        recordEntry.UserName = "TestName"
        recordEntry.BMI = bMI
        recordEntry.BMR = bMR
        recordEntry.FTM = fTM
        recordEntry.TDEE = tDEE
        recordEntry.TodayDate = dateForToday
        recordEntry.InsertRecord()



Dim connectionString As String = ConfigurationManager.ConnectionStrings("ASPNETDBConnectionString").ConnectionString

Sys.Net.WebServiceFailedException: The server method '' failed with the following error:

  

 Hello...

Let's say we have 2 time consuming functions, aaa and aaa1 inside a aspx page.

[WebMethod]
        public static string aaa(int i)
        {
            Thread.Sleep(1000);
            return i.ToString();
        }

        [WebMethod]
        public static string aaa1(int i)
        {
            Thread.Sleep(1000);
            return i.ToString();
        }

 

 

<div>
        <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
        </asp:ScriptManager>
        <span id="displayspan"></span>
        <br />
        <input type="button" value=

Jscript error: Object does not support property or method

  

 Hi, i have little knowledge on javascript but i need to use this code get from somewhere for a jquery to work.

I face this "Jscript runtime error: Object does not support property or method" whenever im trying to run this page.

In my experience, im get this error msg 9 out of 10 times i use javascript in my system.

Im using Microsoft Visual web developer 2008, i wonder if this is related to my problem, i not sure there is anything i need to add as reference or update anything.

But anyway, in short, i just couldn't use javascript code when using this development tool because of this sort of error.

Anyway, it happen that last time i tried use the same type of jquery code in another project and it seems to work well without an error.

But now when im try to use it again in this recent project i created, it come out with this error and i have no idea how to solve it even look through google and this forum.

It doesn't really seems like its the code problem itself although im not sure, because any javascript code just couldn't work.

So below is my code that i need to use.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" ></script>
<script type="text/javascript" src=&quo
Categories: 
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