• 大小: 1.71MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-24
  • 语言: C#
  • 标签: FTP  winform  上传  下载  

资源简介

一个winform程序,简单的FTP 上传下载功能 一个winform程序,简单的FTP 上传下载功能

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using CM.CTOS;

namespace FtpTest
{
    public partial class Form1 : Form
    {
        private string[] UploadFileNames = null;

        public Form1()
        {
            InitializeComponent();
        }

        private void btnSelect_Click(object sender EventArgs e)
        {
            FolderBrowserDialog fbDailog = new FolderBrowserDialog();
            if (fbDailog.ShowDialog() == DialogResult.OK)
            {
                txtPath.Text = fbDailog.SelectedPath;
                if (Directory.Exists(txtPath.Text.Trim()))
                {
                    string[] FileNames = Directory.GetFiles(txtPath.Text.Trim());
                    if (FileNames != null && FileNames.Length > 0)
                    {
                        UploadFileNames = FileNames;
                        foreach (string name in FileNames)
                        {
                            lbFiles.Items.Add(name);
                        }
                    }
                }
            }
        }

        private void btnUpLoad_Click(object sender EventArgs e)
        {
            string msg = string.Empty;
            string upLoadPath = string.Empty;
            if (UploadFileNames != null && UploadFileNames.Length > 0)
            {
                UploadFile uploadFile = new UploadFile();
                if (uploadFile.SendUploadFile(UploadFileNames “ARRIVAL“ new Random().Next(1 999999) ref msg ref upLoadPath))
                {
                    msg += “上传成功!“;
                }
                label2.Text = upLoadPath;
                MessageBox.Show(msg);
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     37376  2018-03-24 17:00  FtpTest\.vs\FtpTest\v15\.suo

     文件          0  2018-03-24 17:00  FtpTest\.vs\FtpTest\v15\Server\sqlite3\db.lock

     文件     569344  2018-03-24 17:00  FtpTest\.vs\FtpTest\v15\Server\sqlite3\storage.ide

     文件       6289  2007-12-13 09:59  FtpTest\Backup\FtpTest\App.config

     文件       1871  2007-12-13 14:17  FtpTest\Backup\FtpTest\Form1.cs

     文件       5320  2007-12-13 14:17  FtpTest\Backup\FtpTest\Form1.Designer.cs

     文件       5814  2007-12-13 14:17  FtpTest\Backup\FtpTest\Form1.resx

     文件       5748  2007-12-13 11:08  FtpTest\Backup\FtpTest\FtpTest.csproj

     文件       3950  2007-12-13 10:27  FtpTest\Backup\FtpTest\NetAddandCancelClient.cs

     文件        466  2007-12-13 09:54  FtpTest\Backup\FtpTest\Program.cs

     文件       1184  2007-12-13 09:54  FtpTest\Backup\FtpTest\Properties\AssemblyInfo.cs

     文件       2869  2007-12-13 09:54  FtpTest\Backup\FtpTest\Properties\Resources.Designer.cs

     文件       5612  2007-12-13 09:54  FtpTest\Backup\FtpTest\Properties\Resources.resx

     文件       1091  2007-12-13 09:54  FtpTest\Backup\FtpTest\Properties\Settings.Designer.cs

     文件        249  2007-12-13 09:54  FtpTest\Backup\FtpTest\Properties\Settings.settings

     文件       6500  2007-12-13 14:13  FtpTest\Backup\FtpTest\UploadFile.cs

     文件       1217  2007-12-13 14:01  FtpTest\Backup\FtpTest.sln

     文件       6289  2007-12-13 09:59  FtpTest\FtpTest\App.config

     文件      18944  2007-11-20 15:00  FtpTest\FtpTest\bin\Debug\CM.CTOS.BLL.Common.dll

     文件      54784  2007-10-11 10:51  FtpTest\FtpTest\bin\Debug\CM.CTOS.BLL.Common.pdb

     文件     237568  2007-12-11 17:19  FtpTest\FtpTest\bin\Debug\CM.CTOS.BLL.EDIManagement.dll

     文件     196608  2007-12-01 15:39  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.AssistantOperation.dll

     文件      44544  2007-12-01 15:39  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.AssistantOperation.pdb

     文件      11776  2007-11-20 15:00  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.Common.dll

     文件      32256  2007-10-16 09:02  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.Common.pdb

     文件    1400832  2007-12-11 17:19  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.EDIManagement.dll

     文件     356352  2007-12-11 13:01  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.ResourceManagement.dll

     文件     519680  2007-12-11 13:01  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.ResourceManagement.pdb

     文件      69632  2007-12-13 08:51  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.SystemManagement.dll

     文件      50688  2007-12-13 08:51  FtpTest\FtpTest\bin\Debug\CM.CTOS.DAL.SystemManagement.pdb

............此处省略72个文件信息

评论

共有 条评论