您的位置:首页 >> 编程开发 >> .NET >> C# >> 正文
RSS
 

C#版ftp方法实现类库代码

http://www.rdxx.com 05年07月27日 21:40 CSDN 我要投稿

关键词: 类库 , 方法 , FTP , C# , 代码 ,

最近要做个MP3搜索,并自动ftp上传的程序,找来找去发现了这个ftp方法的类库不错,发上来给大家共享共享。
/*

FTPFactory.cs

Better view with tab space=4

 

Written by Jaimon Mathew (jaimonmathew@rediffmail.com)

Rolander,Dan (Dan.Rolander@marriott.com) has modified the

download

method to cope with file name with path information. He also

provided

the XML comments so that the library provides Intellisense

descriptions.

 

use the following line to compile

csc /target:library /out:FTPLib.dll /r:System.DLL FTPFactory.cs

*/

 


using
System;

using System.Threading;

using System.Net;

using System.IO;

using System.Text;

using System.Net.Sockets;

using System.Configuration;

 

namespace AudioCollect

{

     /// <summary>

     /// FTPFactory 的摘要说明。

     /// </summary>

     public class FTPFactory

     {

         static readonly log4net.ILog log = log4net.LogManager.GetLogger("log4net");

         private string

              remoteHost,remotePath,remoteUser,remotePass,mes;

         private int remotePort,bytes;

         private Socket clientSocket;

 

         private int retValue;

         private Boolean debug;

         private Boolean logined;

         private string reply;

        

 

         private static int BLOCK_SIZE = 512;

 

         Byte[] buffer = new Byte[BLOCK_SIZE];

         Encoding ASCII = Encoding.ASCII;

 

         public FTPFactory()

         {

 

                  

              string FTPRemoteIP = ConfigurationSettings.AppSettings["FTPRemoteIP"];

              int FTPRemotePort = Convert.ToInt32( ConfigurationSettings.AppSettings["FTPRemotePort"] );

              string FTPUser = ConfigurationSettings.AppSettings["FTPUser"];

              string FTPPassword = ConfigurationSettings.AppSettings["FTPPassword"];

 

             

共23页  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

 
 
标签: 类库 , 方法 , FTP , C# , 代码 , 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站