C#编写的FTP上传简单工具类
///param name=remotePort/parampublic FTPClient(string remoteHost, string remotePath, string remoteUser, string remotePass,int remotePort)strRemoteHost=remoteHost;s trRemoteP ath=remoteP ath;strRemoteUs er=remoteUs er;strRemotePas s=remotePas s;strRemotePort=remotePort;
Connect();
#endregion
//FTPClient fc=new FTPClient( 172.22.1.15, /bcgz/x25/awstod,zxt, 123456,21);
// //fc.ChDir( /bcgz/x25/awstod
// //Console.WriteLine(fc.RemotePath);
//fc.Get(S 5290900.A1053 ,@F:\ttt,
// //fc.getawsFile(S5290400.A1053
#region登陆
///s ummary
///FTP服务器IP地址
////s ummaryprivate string strRemoteHost;public string RemoteHostreturn strRemoteHost;
strRemoteHost=value;
///s ummary
///FTP服务器端口
////s ummaryprivate int strRemotePort;public int RemotePortreturn strRemotePort;strRemotePort=value;
///s ummary
///当前服务器目录
////s ummaryprivate string strRemotePath;public string RemotePathreturn s trRemotePath;s trRemoteP ath=value;
///s ummary
///登录用户账号
////s ummaryprivate string strRemoteUser;public string RemoteUs ers trRemoteUs er=value;
///s ummary
///用户登录密码
////s ummaryprivate string strRemotePas s;public string RemotePassstrRemotePas s=value;
///s ummary
///是否登录
////s ummaryprivate Boolean bConnected;public bool Connectedreturn bConnected;
#endregion
#region链接
///s ummary
///建立连接
////s ummarypublic void Connect()socketControl = new Socket(AddressFamily.InterNetwork, SocketType.Stream,Protoc olType.Tcp);
IPEndPoint ep=new IPEndPoint(IPAddress.Parse(RemoteHost), strRemotePort);
//链接s ocketControl.Connect(ep);
c atch(Exc eption)throw new IOException(Couldnt connect to remote server//获取应答码
Re adRep ly();if(iReply Code !=220)
Dis Connect();throw new IOExc eption(strReply.Substring(4));
//登陆
S endCommand(US ER+s trRemoteUs er);if(!(iRep lyCode==331 | | iReplyCod e==230))
CloseSocketConnect();//关闭连接throw new IOExc eption(strReply.Substring(4));if(iReply Code !=230)
SendCommand(PAS S+strRemotePas s);if(!(iRep lyCode==230| | iReplyCod e==202))
CloseSocketConnect();//关闭连接throw new IOExc eption(strReply.Substring(4));bConnec ted=true;
//切换到目录
ChD ir(s trRemoteP ath);
///param name=ttType传输模式/parampublic void SetTransferType(TransferType ttType)
if(ttTyp e==T ransferTyp e.Binary)
SendCommand(TYPE I //binary类型传输els e
SendCommand(TYPE A//ASCII类型传输if(iReply Code !=200)throw new IOExc eption(strReply.Substring(4));els etr Typ e=ttTyp e;
wordpress高级跨屏企业主题,通用响应式跨平台站点开发,自适应PC端+各移动端屏幕设备,高级可视化自定义设置模块+高效的企业站搜索优化。wordpress绿色企业自适应主题采用标准的HTML5+CSS3语言开发,兼容当下的各种主流浏览器: IE 6+(以及类似360、遨游等基于IE内核的)、Firefox、Google Chrome、Safari、Opera等;同时支持移动终端的常用浏览器应...
介绍:819云怎么样?819云创办于2019,由一家从2017年开始从业的idc行业商家创办,主要从事云服务器,和物理机器819云—-带来了9月最新的秋季便宜vps促销活动,一共4款便宜vps,从2~32G内存,支持Windows系统,…高速建站的美国vps位于洛杉矶cera机房,服务器接入1Gbps带宽,采用魔方管理系统,适合新手玩耍!官方网站:https://www.8...
HostKvm发布了夏季特别促销活动,针对香港国际/韩国机房VPS主机提供7折优惠码,其他机房全场8折,优惠后2GB内存套餐月付仅5.95美元起。这是一家成立于2013年的国外主机服务商,主要提供基于KVM架构的VPS主机,可选数据中心包括日本、新加坡、韩国、美国、中国香港等多个地区机房,均为国内直连或优化线路,延迟较低,适合建站或者远程办公等。下面分享几款香港VPS和韩国VPS的配置和价格信息。...