亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ftpfactory.txt

?? 用C#寫的一個(gè)FTP類,下載了只要拿去用就行!
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
    public class FTPFactory
    {

        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()
        {

            remoteHost = "localhost";
            remotePath = ".";
            remoteUser = "anonymous";
            remotePass = "anonymous";
            remotePort = 21;
            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()
        {
            return remoteHost;
        }

        ///
        /// Set the port number to use for FTP.
        ///
        /// Port number
        public void setRemotePort(int remotePort)
        {
            this.remotePort = remotePort;
        }

        ///
        /// Return the current port number.
        ///
        /// Current port number
        public int getRemotePort()
        {
            return remotePort;
        }

        ///
        /// Set the remote directory path.
        ///
        /// The remote directory path
        public void setRemotePath(string remotePath)
        {
            this.remotePath = remotePath;
        }

        ///
        /// Return the current remote directory path.
        ///
        /// The current remote directory path.
        public string getRemotePath()
        {
            return remotePath;
        }

        ///
        /// Set the user name to use for logging into the remote server.
        ///
        /// Username
        public void setRemoteUser(string remoteUser)
        {
            this.remoteUser = remoteUser;
        }

        ///
        /// Set the password to user for logging into the remote server.
        ///
        /// Password
        public void setRemotePass(string remotePass)
        {
            this.remotePass = remotePass;
        }

        ///
        /// Return a string array containing the remote directory's file list.
        ///
        ///
        ///
        public string[] getFileList(string mask)
        {

            if (!logined)
            {
                login();
            }

            Socket cSocket = createDataSocket();

            sendCommand("NLST " + mask);

            if (!(retValue == 150 || retValue == 125))
            {
                throw new IOException(reply.Substring(4));
            }

            mes = "";

            while (true)
            {

                int bytes = cSocket.Receive(buffer, buffer.Length, 0);
                mes += ASCII.GetString(buffer, 0, bytes);

                if (bytes < buffer.Length)
                {
                    break;
                }
            }

            char[] seperator = { '\n' };
            string[] mess = mes.Split(seperator);

            cSocket.Close();

            readReply();

            if (retValue != 226)
            {
                throw new IOException(reply.Substring(4));
            }
            return mess;

        }

        ///
        /// Return the size of a file.
        ///
        ///
        ///
        public long getFileSize(string fileName)
        {

            if (!logined)
            {
                login();
            }

            sendCommand("SIZE " + fileName);
            long size = 0;

            if (retValue == 213)
            {
                size = Int64.Parse(reply.Substring(4));
            }
            else
            {
                throw new IOException(reply.Substring(4));
            }

            return size;

        }

        ///
        /// Login to the remote server.
        ///
        public void login()
        {

            clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
            IPEndPoint ep = new IPEndPoint(Dns.Resolve(remoteHost).AddressList[0], remotePort);

            try
            {
                clientSocket.Connect(ep);
            }
            catch (Exception)
            {
                throw new IOException("Couldn't connect to remote server");
            }

            readReply();
            if (retValue != 220)
            {
                close();
                throw new IOException(reply.Substring(4));
            }
            if (debug)
                Console.WriteLine("USER " + remoteUser);

            sendCommand("USER " + remoteUser);

            if (!(retValue == 331 || retValue == 230))
            {
                cleanup();
                throw new IOException(reply.Substring(4));
            }

            if (retValue != 230)
            {
                if (debug)
                    Console.WriteLine("PASS xxx");

                sendCommand("PASS " + remotePass);
                if (!(retValue == 230 || retValue == 202))
                {
                    cleanup();
                    throw new IOException(reply.Substring(4));
                }
            }

            logined = true;
            Console.WriteLine("Connected to " + remoteHost);

            chdir(remotePath);

        }
///
        /// If the value of mode is true, set binary mode for downloads.
        /// Else, set Ascii mode.
        ///
        ///
        public void setBinaryMode(Boolean mode)
        {

            if (mode)
            {
                sendCommand("TYPE I");
            }
            else
            {
                sendCommand("TYPE A");
            }
            if (retValue != 200)
            {
                throw new IOException(reply.Substring(4));
            }
        }

        ///
        /// Download a file to the Assembly's local directory,
        /// keeping the same file name.
        ///
        ///
        public void download(string remFileName)
        {
            download(remFileName, "", false);
        }

        ///
        /// Download a remote file to the Assembly's local directory,
        /// keeping the same file name, and set the resume flag.
        ///
        ///
        ///
        public void download(string remFileName, Boolean resume)
        {
            download(remFileName, "", resume);
        }

        ///
        /// Download a remote file to a local file name which can include
        /// a path. The local file name will be created or overwritten,
        /// but the path must exist.
        ///
        ///
        ///
        public void download(string remFileName, string locFileName)
        {
            download(remFileName, locFileName, false);
        }

        ///
        /// Download a remote file to a local file name which can include
        /// a path, and set the resume flag. The local file name will be
        /// created or overwritten, but the path must exist.
        ///
        ///
        ///
        ///
        public void download(string remFileName, string
            locFileName, Boolean resume)
        {
            if (!logined)
            {
                login();
            }

            setBinaryMode(true);

            //Console.WriteLine("Downloading file "+remFileName+" from "+remoteHost + "/"+remotePath);

            if (locFileName.Equals(""))
            {
                locFileName = remFileName;
            }

            if (!File.Exists(locFileName))
            {
                Stream st = File.Create(locFileName);
                st.Close();
            }

            FileStream output = new FileStream(locFileName, FileMode.Open);

            Socket cSocket = createDataSocket();

            long offset = 0;

            if (resume)
            {

                offset = output.Length;

                if (offset > 0)
                {
                    sendCommand("REST " + offset);
                    if (retValue != 350)
                    {
                        //throw new IOException(reply.Substring(4));
                        //Some servers may not support resuming.
                        offset = 0;
                    }
                }

                if (offset > 0)
                {
                    if (debug)
                    {
                        //Console.WriteLine("seeking to " + offset);
                    }
                    long npos = output.Seek(offset, SeekOrigin.Begin);
                    //Console.WriteLine("new pos="+npos);
                }
            }

            sendCommand("RETR " + remFileName);

            if (!(retValue == 150 || retValue == 125))
            {
                //throw new IOException(reply.Substring(4));
            }

            while (true)
            {

                bytes = cSocket.Receive(buffer, buffer.Length, 0);
                output.Write(buffer, 0, bytes);

                if (bytes <= 0)
                {
                    break;
                }
            }

            output.Close();
            if (cSocket.Connected)
            {
                cSocket.Close();
            }

            //Console.WriteLine("");

            readReply();

            if (!(retValue == 226 || retValue == 250))

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
波多野结衣在线aⅴ中文字幕不卡| 不卡的av在线| 久久免费看少妇高潮| 97久久久精品综合88久久| 日韩国产精品久久久久久亚洲| 国产欧美一区在线| 制服丝袜一区二区三区| a级高清视频欧美日韩| 精品一区二区日韩| 亚洲一区二区三区免费视频| 久久精品视频免费| 制服丝袜亚洲色图| 欧洲生活片亚洲生活在线观看| 久久你懂得1024| 成人一级片在线观看| 日本大胆欧美人术艺术动态 | 91女神在线视频| 日本午夜一区二区| 亚洲一区国产视频| 亚洲免费资源在线播放| 国产精品美女久久久久久| 26uuu欧美日本| 91精品国产免费| 欧美性视频一区二区三区| 99久久国产综合精品女不卡| 国产精品伊人色| 久久国产精品露脸对白| 免费av成人在线| 蜜臀av性久久久久蜜臀av麻豆| 亚洲第一主播视频| 亚洲午夜久久久久| 亚洲一区二区高清| 亚洲va欧美va人人爽| 亚洲午夜久久久久久久久电影院 | 中文字幕日韩欧美一区二区三区| 日韩精品影音先锋| 日韩欧美激情四射| 日韩亚洲欧美中文三级| 欧美一区二区播放| 欧美一卡二卡三卡| 日韩精品一区二区三区在线观看| 91精选在线观看| 欧美大片国产精品| 欧美精品一区二区久久婷婷| 久久色中文字幕| 国产色产综合产在线视频| 久久嫩草精品久久久久| 国产欧美精品一区二区色综合朱莉 | 男男成人高潮片免费网站| 偷偷要91色婷婷| 麻豆精品视频在线观看| 另类人妖一区二区av| 国产剧情一区二区| 成人99免费视频| 色综合av在线| 777久久久精品| 久久亚洲一区二区三区四区| 国产欧美日韩精品在线| 亚洲另类色综合网站| 亚洲一区精品在线| 久久99精品国产麻豆婷婷| 国产高清精品在线| 91精品福利视频| 欧美一区二区三区在线观看视频| 日韩你懂的在线播放| 日本一区二区三区在线不卡| 国产精品福利av| 亚洲成av人片在www色猫咪| 老司机免费视频一区二区三区| 国产在线不卡一区| www.成人网.com| 欧美日韩国产中文| 久久久综合激的五月天| 亚洲欧美激情在线| 日本在线不卡一区| 成人性生交大片免费看在线播放| 91黄视频在线观看| 日韩无一区二区| 国产精品免费免费| 日韩va欧美va亚洲va久久| 丁香啪啪综合成人亚洲小说| 欧美视频三区在线播放| 久久影院午夜片一区| 亚洲女厕所小便bbb| 免费的国产精品| 波波电影院一区二区三区| 欧美日韩视频第一区| 久久久久久久久一| 亚洲欧美另类小说| 精品影视av免费| 91黄色免费版| 国产欧美日韩视频一区二区| 日韩国产精品久久久久久亚洲| 风间由美一区二区三区在线观看| 欧美久久久久中文字幕| 国产精品乱码人人做人人爱 | 99视频一区二区| 精品蜜桃在线看| 亚洲国产精品天堂| 99久久国产免费看| 久久精品视频一区| 裸体歌舞表演一区二区| 91视频免费看| 久久婷婷国产综合精品青草| 亚洲国产精品尤物yw在线观看| 国产一区欧美日韩| 欧美一区二区视频网站| 一区二区久久久久| 成人av在线资源网| 久久人人超碰精品| 另类欧美日韩国产在线| 欧美欧美欧美欧美| 亚洲在线观看免费视频| 99精品视频在线播放观看| 久久久久久久精| 久久不见久久见免费视频7| 欧美美女网站色| 亚洲成人av一区| 日本韩国精品在线| 日韩理论片中文av| 成人免费毛片a| 欧美经典三级视频一区二区三区| 黄一区二区三区| 欧美成人综合网站| 看片网站欧美日韩| 欧美大度的电影原声| 日本欧美一区二区在线观看| 欧美精品久久久久久久多人混战| 一区二区三区在线观看网站| 91免费国产在线观看| 国产精品国产三级国产专播品爱网| 国产精品一区二区黑丝| 久久婷婷成人综合色| 国产麻豆欧美日韩一区| 久久久精品综合| 国产成人免费视频网站高清观看视频 | 自拍视频在线观看一区二区| 国产成人鲁色资源国产91色综| 久久午夜色播影院免费高清| 国产精品亚洲成人| 国产精品午夜久久| www.欧美亚洲| 玉米视频成人免费看| 欧美在线免费播放| 五月婷婷欧美视频| 欧美一级午夜免费电影| 国产一区二区在线免费观看| 久久人人超碰精品| 99re热视频精品| 亚洲成人av电影在线| 日韩欧美视频在线| 激情综合色播五月| 亚洲国产精品av| 99国产欧美久久久精品| 一区二区三区成人| 91精品国产欧美一区二区 | 欧美午夜寂寞影院| 日韩精品一二区| 国产亚洲欧美中文| 91免费观看在线| 日本不卡视频在线观看| 久久精品欧美日韩精品| 91日韩一区二区三区| 日日夜夜免费精品视频| 久久蜜桃av一区精品变态类天堂| www.av精品| 日本美女一区二区三区视频| 久久久亚洲高清| 91婷婷韩国欧美一区二区| 日韩制服丝袜av| 国产精品网曝门| 欧美日韩第一区日日骚| 国产不卡视频在线观看| 一级日本不卡的影视| 日韩免费视频线观看| 不卡的电影网站| 七七婷婷婷婷精品国产| 国产精品久久免费看| 欧美日韩成人在线一区| 成人免费毛片app| 免费久久精品视频| 最新国产精品久久精品| 日韩亚洲欧美中文三级| 色综合中文综合网| 国产亚洲精品aa| 欧美在线free| 国产乱人伦精品一区二区在线观看| 中文字幕亚洲区| 精品少妇一区二区三区视频免付费| av在线播放一区二区三区| 毛片av一区二区三区| 亚洲欧美视频在线观看| 久久人人超碰精品| 欧美日韩精品二区第二页| 岛国一区二区三区| 麻豆91在线看| 亚洲.国产.中文慕字在线| 亚洲欧洲日产国码二区| 久久亚洲综合色一区二区三区| 欧美卡1卡2卡|