欢迎光临极品网,更多、更新的资源信息尽在Jpinw.Com!本站所有信息资源每日更新新的内容,请大家继续关注www.Jpinw.com!如果觉得本站还不错,对您有帮助,别忘了向您的朋友推荐本站!请记好本站网址:http://www.Jpinw.com,网站发展靠大家多多的支持!!!

极品网 极品课件 极品论文 极品文学 极品游戏 极品美容 极品手机资源 极品股票

#
免费资源: 免费域名 | 免费空间 | 免费推广 | 免费邮箱 | 免费硬盘 | 免费论坛 | 免费留言 | 免费统计 | 在线投稿 | 更多...
电脑学院: 操作系统 | 安全相关 | 网页设计 | 编程开发 | 建站经验 | 服务器类 | 黑客攻防 | 菜鸟入门 | 教你网赚 | 更多...
文章导航: 网赚学堂 | 网赚秘笈 | 网赚三维 | 网赚先锋 | 网赚资讯 | 感悟网赚 | 众生百态 | 经典美文 | 范文中心 | 更多...
图酷天下: 时事图酷 | 娱乐图酷 | 搞笑图酷 | 时尚图酷 | 体育图酷 | 另类经典 | 论文资源 | 课件下载 | 文学知识 | 更多...

您现在的位置: 极品网 >> 电脑学院 >> 编程开发 >> C#VBJAVA >> 教程正文

C#版ftp方法实现类库代码            【字体:
C#版ftp方法实现类库代码
作者:佚名    教程来源:不详    点击数:    更新时间:2008-6-4    

 








C#版ftp方法实现类库代码。
  最近要做个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"];



remoteHost = FTPRemoteIP;

remotePath = ".";

remoteUser = FTPUser;

remotePass = FTPPassword;

remotePort =FTPRemotePort;

debug = false;

logined = false;



}



///

/// Set the name of the FTP server to connect to.

///

/// Server name

public void setRemoteHost(string remoteHost)

{

this.remoteHost = remoteHost;

}



///

/// Return the name of the current FTP server.

///

/// Server name

public string getRemoteHost()

[1] [2] [3] 下一篇

 

教程录入:admin    责任编辑:admin 
  • 上一篇教程:

  • 下一篇教程:
  • 发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    最新热点 最新推荐 相关教程
    C#:Web Service异常处理
    C#:获得文件版本信息及只读文
    C#:文件的按行读/写及文件目
    C#2.0 Specification(泛型二
    C#2.0 Specification(泛型一
    C#2.0 新特性探究(二) 委托与
    C#2.0的特性
    C#2.0简介
    C#2.0语言规范(三)匿名方法
    C#2.0语言规范(四)迭代器
      网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!)
    极品网
    | 设为首页 | 加入收藏 | 友情链接 | 版权声明 |
    极品网

    Copyright 2006 Jpinw.com 极品网

    备案号:浙ICP备07010375号

    极品网