473,411 Members | 1,975 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

help with FTP clients.

Dear sir,

I am trying to write an FTP class using system.net sockets. I am using XP.
The class never works, it seems that the client always waiting for response
from server. So I try to connect to Remote FTP server using telnet, then I
always get an error of
"425 Can't open data connection

Below are a part of my code, does some one able to tell me what I did wrong/

qqTcpClient = New System.Net.Sockets.TcpClient
Console.WriteLine("I am testing")
Dim Reply As String
Console.WriteLine("connecting")
qqTcpClient.Connect("217.170.3.24", 21)
qqNetworkStream = qqTcpClient.GetStream()
Reply = GetResponse()
Console.WriteLine(Reply)
Console.WriteLine("loging")

SendText("HELP")

' it stops here.

Private Sub SendText(ByVal strMsg As String)
Dim strByte As [Byte]()
strByte = System.Text.Encoding.ASCII.GetBytes(strMsg.ToCharA rray())
qqNetworkStream.Write(strByte, 0, strByte.Length)
End Sub
--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com

Nov 21 '05 #1
1 997
Hi,

Here is an example that uses indy to do ftp. Indy is an open source
project.

www.onteorasoftware.com/downloads/indy.zip

http://www.indyproject.org/Indy.html

Ken
------------------
"Guoqi Zheng" <no@sorry.nl> wrote in message
news:um**************@TK2MSFTNGP15.phx.gbl...
Dear sir,

I am trying to write an FTP class using system.net sockets. I am using XP.
The class never works, it seems that the client always waiting for response
from server. So I try to connect to Remote FTP server using telnet, then I
always get an error of
"425 Can't open data connection

Below are a part of my code, does some one able to tell me what I did wrong/

qqTcpClient = New System.Net.Sockets.TcpClient
Console.WriteLine("I am testing")
Dim Reply As String
Console.WriteLine("connecting")
qqTcpClient.Connect("217.170.3.24", 21)
qqNetworkStream = qqTcpClient.GetStream()
Reply = GetResponse()
Console.WriteLine(Reply)
Console.WriteLine("loging")

SendText("HELP")

' it stops here.

Private Sub SendText(ByVal strMsg As String)
Dim strByte As [Byte]()
strByte = System.Text.Encoding.ASCII.GetBytes(strMsg.ToCharA rray())
qqNetworkStream.Write(strByte, 0, strByte.Length)
End Sub
--
Kind regards

Guoqi Zheng
guoqi AT meetholland dot com
Http://www.meetholland.com


Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Vikram Vaswani | last post by:
Hi all, I have the following two tables: mysql> SELECT * FROM clients; +-----+-----------------------------+ | cid | cname | +-----+-----------------------------+ |...
1
by: Frank | last post by:
Hi, is there a way to use XSL to compare two XML files to verify if a "record" in an XML file has changed of parent in another XML file ? I am trying to implement a template in an XSL stylesheet...
0
by: Ked | last post by:
Any help in this matter will be gr8!! I have 1 XML file: I am giving the example: <emails> <email> <clients> <client>
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
27
by: Chuck Grimsby | last post by:
(Repost, due to lack of submissions...) The Microsoft Access Product Group (the people who build Microsoft Access) want your help! One of the main things we're working on for the near future...
1
by: Diego F. | last post by:
Hello. I hope you can help me with this. I have to write an application in C# that is more or less this: 1.- I have different clients that receive data from a central server. 2.- The server...
2
by: Jake | last post by:
Hello, I need some help and if anyone can figure this out I will bow to him/her. We have a vb.net app that is trying to transfer files from a client's w2k tablet pc to our server. The app is...
3
by: Saxman | last post by:
=DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'")+DCount("*","Clients"," = '1'") The...
4
by: J | last post by:
I am editing a pre-existing view. This view is already bringing data from 40+ tables so I am to modify it without screwing with anything else that is already in there. I need to (left) join it...
1
by: Confuzled | last post by:
Hi there. I am using a union to show waste products and recycable products. You will see by the code, the waste and recycable values show in the same fields - But I would like them to be in...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.