### 2023-02-21更新

------
#### SuperDesign    V3.0.2302.2101
- *.[新增]全新文本编辑器,支持高亮、FTP查看和编辑、目录浏览,历史版本等众多功能。
This commit is contained in:
鑫Intel committed 2023-02-21 09:46:13 +08:00
1 parent c7b33920bd
commit 03bcb8c5fd
406 files changed
+312053 -48889

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1,55 @@
using FTPop;
using GameBackup3H3.DbOp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.WebRequestMethods;
namespace SuperDesign.Manager.FTP
{
public class FTPManger
{
public static Dictionary<int, IFTP> dict_ftp = new Dictionary<int, IFTP>();
/// <summary>
/// 文件传输事件
/// </summary>
public static event FileTransferProgressEventHandler FileTransferProgress;
public static IFTP GetFTP(FTPInfo ftpinfo,out int result)
{
var ftpid = ftpinfo.Id;
if (dict_ftp.ContainsKey(ftpid))
{
var ftp =dict_ftp[ftpid];
if (ftp.IsOpen)
{
result = 1;
return ftp;
}
else
{
ftp.Close();
var ftp2 = new FTPop.FTPWinSCP();
ftp2.FileTransferProgress += Ftp_FileTransferProgress;
result = ftp2.Open(ftpinfo);
dict_ftp[ftpid] = ftp2;
return ftp2;
}
}
else
{
var ftp = new FTPop.FTPWinSCP();
ftp.FileTransferProgress += Ftp_FileTransferProgress;
result =ftp.Open(ftpinfo);
dict_ftp[ftpid] = ftp;
return ftp;
}
}
private static void Ftp_FileTransferProgress(object sender, FileTransferProgressEventArgs e)
{
FileTransferProgress?.Invoke(sender, e);
}
}
}
@@ -0,0 +1,312 @@
using FluentFTP;
using FluentFTP.Client.BaseClient;
using GameBackup3H3.DbOp;
using ryCommon;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Net;
using System.Text;
#pragma warning disable CA1031 // 不捕获常规异常类型
namespace FTPop
{
/// <summary>
/// FTP管理
/// </summary>
public class FTPFluentFTP : IFTP, IDisposable
{
private bool disposed = false;
FtpClient conn;
public string CurRemoteFolder { get; private set; } = "";
FTPInfo _ftpinfo;
private Encoding GetEncoding()
{
if (_ftpinfo.Encoding == "UTF8")
{ return Encoding.UTF8; }
else
{ return Encoding.GetEncoding(_ftpinfo.Encoding); }
}
private void AppendText(string text, Color color)
{
}
/// <summary>
/// 打开FTP
/// </summary>
/// <param name="ftpinfo"></param>
public int Open(FTPInfo ftpinfo)
{
if(ftpinfo==null)
{
return -1;
}
_ftpinfo = ftpinfo;
conn = new FtpClient
{
Host = _ftpinfo.IP,
Port = _ftpinfo.Port,
Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd)
};
conn.Config.ConnectTimeout = 35000;
conn.Config.DataConnectionConnectTimeout = 35000;
conn.Config.DataConnectionReadTimeout = 35000;
conn.Config.ReadTimeout = 35000;
conn.Config.DataConnectionType = FtpDataConnectionType.AutoPassive;
conn.Config.SslProtocols = System.Security.Authentication.SslProtocols.Tls12;
try
{
if (_ftpinfo.Encrypt > 0)
{
conn.Config.EncryptionMode = _ftpinfo.Encrypt == 2 ? FtpEncryptionMode.Explicit : FtpEncryptionMode.Implicit;
conn.Config.ValidateAnyCertificate = true;
conn.ValidateCertificate += new FtpSslValidation(OnValidateCertificate);
}
conn.Config.DataConnectionEncryption = true;
conn.Connect();
if (conn.IsConnected)
{
ChangeWorkingDirectory("");
//conn.DataConnectionType = FtpDataConnectionType.PASV;
//var ss= conn.GetListing();
}
}
catch(Exception ex)
{
return -2;
}
return conn.IsConnected?1:0;
}
private void AsyncMethod()
{
//var kk = await conn.GetListingAsync();
}
private static void OnValidateCertificate(BaseFtpClient control, FtpSslValidationEventArgs e)
{
if (e.PolicyErrors != System.Net.Security.SslPolicyErrors.None)
{
// invalid cert, do you want to accept it?
e.Accept = true;
}
else
{
e.Accept = true;
}
}
private bool ChangeWorkingDirectory(string Path)
{
if (Path == null || Path.Length == 0)
{
AppendText("Status : Directory Was Not Found\n", Color.Red);
return false;
}
conn.SetWorkingDirectory(Path);
CurRemoteFolder = Path;
AppendText("Status : Current Working Directory is " + CurRemoteFolder + "\n", Color.Red);
return true;
}
/// <summary>
/// 关闭FTP
/// </summary>
/// <returns></returns>
public int Close()
{
conn.Disconnect();
conn.Dispose();
return 1;
}
/// <summary>
/// 移除文件
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public int RemoveFiles(string remotePath)
{
conn.DeleteFile(remotePath);
return 1;
}
/// <summary>
/// 移动文件
/// </summary>
/// <param name="fromPath"></param>
/// <param name="toPath"></param>
/// <returns></returns>
public int MoveFile(string fromPath, string toPath)
{
conn.Rename(fromPath, toPath);
return 1;
}
/// <summary>
/// 文件是否存在
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public bool FileExists(string remotePath)
{
return conn.FileExists(remotePath);
}
/// <summary>
/// 文件大小
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public Int64 FileSize(string remotePath)
{
try
{
return conn.GetFileSize(remotePath);
}
catch { return -1; }
}
/// <summary>
/// 文件最后修改时间
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public DateTime FileLastWriteTime(string remotePath)
{
try
{
return conn.GetModifiedTime(remotePath);
}
catch { return new DateTime(2000,1,1); }
}
/// <summary>
/// 文件信息
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public RemoteFileInfo GetFileInfo(string remotePath)
{
try
{
return new RemoteFileInfo()
{
LastWriteTime = conn.GetModifiedTime(remotePath),
Length = conn.GetFileSize(remotePath),
Name = System.IO.Path.GetFileName(remotePath),
IsDirectory = conn.DirectoryExists(remotePath)
};
}
catch
{
return new RemoteFileInfo();
}
}
/// <summary>
/// 显示文件夹列表
/// </summary>
/// <param name="CurFolder"></param>
/// <returns></returns>
public List<RemoteFileInfo> ListDirectory(string CurFolder)
{
//var aa = conn.GetNameListing(CurFolder) ;
List<RemoteFileInfo> list = new List<RemoteFileInfo>();
conn.Encoding = GetEncoding();
var list_conn= conn.GetListing(CurFolder.TrimEnd('/'));
//var list_conn2 = conn.GetNameListing();
for (int i = 0; i < list_conn.Length; i++)
{
var item = list_conn[i];
list.Add(new RemoteFileInfo()
{
FullName = item.FullName,
IsDirectory = item.Type== FtpObjectType.Directory,
Name = item.Name,
Length = item.Size,
LastWriteTime = item.Modified
});
}
return list;
}
/// <summary>
/// 上传
/// </summary>
/// <param name="localPath"></param>
/// <param name="remotePath"></param>
/// <returns></returns>
public int Upload(string localPath, string remotePath)
{
try
{
Action<FtpProgress> progress = delegate (FtpProgress p)
{
var progress2 = new FileTransferProgressEventArgs()
{
Cancel = false,
LocalPath = localPath,
FileProgress = p.Progress/100d,
IsComplete=p.Progress==100,
Speed=p.TransferSpeed
};
FileTransferProgress?.Invoke(this, progress2);
//if (progress2.Cancel) {p.=true ; }
if (p.Progress == 1)
{
// all done!
}
else
{
// percent done = (p.Progress * 100)
}
};
// upload a file with progress tracking
var result= conn.UploadFile(localPath, remotePath, FtpRemoteExists.Overwrite, true, FtpVerify.None, progress);
if (result == FtpStatus.Success)
{
if (FileSize(remotePath) != RyFiles.GetFileSize(localPath))
{
ErrorMsg = "文件上传不完整";
return -1;
}
else
{
return 1;
}
}
return -2;
}
catch (Exception ex)
{
ErrorMsg = ex.Message;
return -1;
}
}
public string ErrorMsg { get; set; } = "";
/// <summary>
/// 文件传输事件
/// </summary>
public event FileTransferProgressEventHandler FileTransferProgress;
~FTPFluentFTP()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
Close();
// If disposing equals true, dispose all managed
// and unmanaged resources.
if (disposing)
{
// Dispose managed resources.
}
// Release unmanaged resources. If disposing is false,
// only the following code is executed.
// Note that this is not thread safe.
// Another thread could start disposing the object
// after the managed resources are disposed,
// but before the disposed flag is set to true.
// If thread safety is necessary, it must be
// implemented by the client.
}
disposed = true;
}
}
}
@@ -0,0 +1,459 @@
using GameBackup3H3.DbOp;
using ryCommon;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Text.RegularExpressions;
using WinSCP;
#pragma warning disable CA1031 // 不捕获常规异常类型
namespace FTPop
{
/// <summary>
/// FTP管理
/// </summary>
public class FTPFtpWeb : IFTP, IDisposable
{
private bool disposed = false;
string ftpURI;
public string CurRemoteFolder { get; private set; } = "";
FTPInfo _ftpinfo;
private Encoding GetEncoding()
{
if (_ftpinfo.Encoding == "UTF8")
{ return Encoding.UTF8; }
else
{ return Encoding.GetEncoding(_ftpinfo.Encoding); }
}
private static bool OnCertificateValidation(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
/* Console.WriteLine("Server Certificate Issued To: {0}", certificate.GetName());
Console.WriteLine("Server Certificate Issued By: {0}", certificate.GetIssuerName());
// Return true if there are no policy errors
// The certificate can also be manually verified to
//make sure it meets your specific // policies by
// interrogating the x509Certificate object.
if (errors != SslPolicyErrors.None)
{
Console.WriteLine("Server Certificate Validation Error");
Console.WriteLine(errors.ToString());
return false;
}
else
{
Console.WriteLine("No Certificate Validation Errors");
return true;
}*/
return true; //所有證書都合法
}
private void ShowCertificateInfo(X509Certificate remoteCertificate, bool verbose)
{
//Console.WriteLine("Certficate Information for:/n{0}/n", remoteCertificate.GetName());
//Console.WriteLine("Valid From: /n{0}", remoteCertificate.GetEffectiveDateString());
//Console.WriteLine("Valid To: /n{0}", remoteCertificate.GetExpirationDateString());
//Console.WriteLine("Certificate Format: /n{0}/n", remoteCertificate.GetFormat());
//Console.WriteLine("Issuer Name: /n{0}", remoteCertificate.GetIssuerName());
//if (verbose)
//{
// Console.WriteLine("Serial Number: /n{0}", remoteCertificate.GetSerialNumberString());
// Console.WriteLine("Hash: /n{0}", remoteCertificate.GetCertHashString());
// Console.WriteLine("Key Algorithm: /n{0}", remoteCertificate.GetKeyAlgorithm());
// Console.WriteLine("Key Algorithm Parameters: /n{0}", remoteCertificate.GetKeyAlgorithmParametersString());
// Console.WriteLine("Public Key: /n{0}", remoteCertificate.GetPublicKeyString());
//}
}
private void showSslInfo(string serverName, SslStream sslStream, bool verbose)
{
ShowCertificateInfo(sslStream.RemoteCertificate, verbose);
Console.WriteLine("/n/nSSL Connect Report for : {0}/n", serverName);
Console.WriteLine("Is Authenticated: {0}", sslStream.IsAuthenticated);
Console.WriteLine("Is Encrypted: {0}", sslStream.IsEncrypted);
Console.WriteLine("Is Signed: {0}", sslStream.IsSigned);
Console.WriteLine("Is Mutually Authenticated: {0}/n", sslStream.IsMutuallyAuthenticated);
Console.WriteLine("Hash Algorithm: {0}", sslStream.HashAlgorithm);
Console.WriteLine("Hash Strength: {0}", sslStream.HashStrength);
Console.WriteLine("Cipher Algorithm: {0}", sslStream.CipherAlgorithm);
Console.WriteLine("Cipher Strength: {0}/n", sslStream.CipherStrength);
Console.WriteLine("Key Exchange Algorithm: {0}", sslStream.KeyExchangeAlgorithm);
Console.WriteLine("Key Exchange Strength: {0}/n", sslStream.KeyExchangeStrength);
Console.WriteLine("SSL Protocol: {0}", sslStream.SslProtocol);
}
private X509CertificateCollection _clientCertificates = new X509CertificateCollection();
private void AppendText(string text, Color color)
{
}
/// <summary>
/// 打开FTP
/// </summary>
/// <param name="ftpinfo"></param>
public int Open(FTPInfo ftpinfo)
{
if(ftpinfo==null)
{
return -1;
}
_ftpinfo = ftpinfo;
AppendText("Status : Connected to " + ftpinfo.IP + "\n", Color.Red);
InitWorkingDirectory();
return 1;
}
private bool InitWorkingDirectory()
{
ftpURI = "ftp://" + _ftpinfo.IP+":"+_ftpinfo.Port + "/";
return true;
}
/// <summary>
/// 关闭FTP
/// </summary>
/// <returns></returns>
public int Close()
{
return 1;
}
int delCount = 0;
public int ReTryCount { get; set; } = 2;
/// <summary>
/// 移除文件
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public int RemoveFiles(string remotePath)
{
InitWorkingDirectory();
try
{
string uri = ftpURI + remotePath;
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
reqFTP.Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd);
reqFTP.KeepAlive = false;
reqFTP.Timeout = 3000;
reqFTP.Method = WebRequestMethods.Ftp.DeleteFile;
ServicePoint currentServicePoint = reqFTP.ServicePoint;
currentServicePoint.ConnectionLimit = 1024;
string result = String.Empty;
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
long size = response.ContentLength;
Stream datastream = response.GetResponseStream();
StreamReader sr = new StreamReader(datastream);
result = sr.ReadToEnd();
sr.Close();
datastream.Close();
response.Close();
delCount = 0;
return 1;
}
catch (Exception ex)
{
delCount++;
if (delCount <= ReTryCount)
{
return RemoveFiles(remotePath);
}
else
{
delCount = 0;
}
AppendText("Delete Error --> " + ex.Message + " 文件名:" + remotePath, Color.Red);
//Insert_Standard_ErrorLog.Insert("FtpWeb", "Delete Error --> " + ex.Message + " 文件名:" + fileName);
return -1;
}
}
/// <summary>
/// 移动文件
/// </summary>
/// <param name="fromPath"></param>
/// <param name="toPath"></param>
/// <returns></returns>
public int MoveFile(string fromPath, string toPath)
{
FtpWebRequest reqFTP;
try
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + fromPath));
reqFTP.Method = WebRequestMethods.Ftp.Rename;
reqFTP.RenameTo = toPath;
reqFTP.UseBinary = true;
reqFTP.KeepAlive = false;
reqFTP.Timeout = 10000;
reqFTP.Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd);
ServicePoint currentServicePoint = reqFTP.ServicePoint;
currentServicePoint.ConnectionLimit = 1024;
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
ftpStream.Close();
response.Close();
}
catch (Exception)
{
return -1;
}
return 1;
}
/// <summary>
/// 文件是否存在
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public bool FileExists(string remotePath)
{
long Filesize = FileSize(remotePath);
return Filesize>0;
}
/// <summary>
/// 文件大小
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public Int64 FileSize(string remotePath)
{
FtpWebRequest reqFTP;
long fileSize;
try
{
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + remotePath));
reqFTP.Method = WebRequestMethods.Ftp.GetFileSize;
reqFTP.UseBinary = true;
reqFTP.KeepAlive = false;
reqFTP.Timeout = 10000;
reqFTP.Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd);
ServicePoint currentServicePoint = reqFTP.ServicePoint;
currentServicePoint.ConnectionLimit = 1024;
FtpWebResponse response = (FtpWebResponse)reqFTP.GetResponse();
Stream ftpStream = response.GetResponseStream();
fileSize = response.ContentLength;
ftpStream.Close();
response.Close();
}
catch (Exception)
{
return -1;
}
return fileSize;
}
/// <summary>
/// 文件最后修改时间
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public DateTime FileLastWriteTime(string remotePath)
{
return new DateTime(2000, 1, 1);
}
/// <summary>
/// 文件信息
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public RemoteFileInfo GetFileInfo(string remotePath)
{
return new RemoteFileInfo();
}
/// <summary>
/// 显示文件夹列表
/// </summary>
/// <param name="CurFolder"></param>
/// <returns></returns>
public List<RemoteFileInfo> ListDirectory(string CurFolder)
{
InitWorkingDirectory();
var list = new List<RemoteFileInfo>();
try
{
string regex =
@"^" + //# Start of line
@"(?<dir>[\-ld])" + //# File size
@"(?<permission>[\-rwx]{9})" + //# Whitespace \n
@"\s+" + //# Whitespace \n
@"(?<filecode>\d+)" +
@"\s+" + //# Whitespace \n
@"(?<owner>\w+)" +
@"\s+" + //# Whitespace \n
@"(?<group>\w+)" +
@"\s+" + //# Whitespace \n
@"(?<size>\d+)" +
@"\s+" + //# Whitespace \n
@"(?<month>\w{3})" + //# Month (3 letters) \n
@"\s+" + //# Whitespace \n
@"(?<day>\d{1,2})" + //# Day (1 or 2 digits) \n
@"\s+" + //# Whitespace \n
@"(?<timeyear>[\d:]{4,5})" + //# Time or year \n
@"\s+" + //# Whitespace \n
@"(?<filename>(.*))" + //# Filename \n
@"$"; //# End of line
StringBuilder result = new StringBuilder();
FtpWebRequest ftp;
ftp = (FtpWebRequest)FtpWebRequest.Create(new Uri(ftpURI + CurFolder));
ftp.Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd);
ftp.Method = WebRequestMethods.Ftp.ListDirectoryDetails;
ftp.KeepAlive = false;
ftp.Timeout = 10000;
if (_ftpinfo.Encrypt > 0)
{
ServicePointManager.ServerCertificateValidationCallback = new
System.Net.Security.RemoteCertificateValidationCallback(OnCertificateValidation);
ftp.ClientCertificates = new X509CertificateCollection();
ftp.AuthenticationLevel = AuthenticationLevel.MutualAuthRequested;
ftp.ImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Identification;
ftp.EnableSsl = true;
}
WebResponse response = ftp.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream(), GetEncoding());
string line = reader.ReadLine();
while (line != null)
{
var split = new Regex(regex).Match(line);
string dir = split.Groups["dir"].ToString();
string filename = split.Groups["filename"].ToString();
var size = split.Groups["size"].ToString();
bool isDirectory = !string.IsNullOrWhiteSpace(dir) && dir.Equals("d", StringComparison.OrdinalIgnoreCase);
list.Add(new RemoteFileInfo()
{
FullName = CurFolder.TrimEnd('/') +"/"+ filename,
IsDirectory = isDirectory,
Name = filename,
Length = size.ToInt64(),
LastWriteTime = (split.Groups["timeyear"].ToString() + " " + split.Groups["month"].ToString() + " " + split.Groups["day"].ToString()).ToDateTime()
}) ;
result.Append(line);
result.Append("\n");
line = reader.ReadLine();
}
result.Remove(result.ToString().LastIndexOf("\n", StringComparison.OrdinalIgnoreCase), 1);
reader.Close();
response.Close();
}
catch (Exception)
{
return list;
}
return list;
}
/// <summary>
/// 上传
/// </summary>
/// <param name="localPath"></param>
/// <param name="remotePath"></param>
/// <returns></returns>
public int Upload(string localPath, string remotePath)
{
FileInfo fileInf = new FileInfo(localPath);
string uri = ftpURI + remotePath;
FtpWebRequest reqFTP;
reqFTP = (FtpWebRequest)FtpWebRequest.Create(new Uri(uri));
reqFTP.Credentials = new NetworkCredential(_ftpinfo.UserName, _ftpinfo.Pwd);
reqFTP.KeepAlive = true;
reqFTP.Method = WebRequestMethods.Ftp.UploadFile;
reqFTP.UseBinary = true;
reqFTP.ContentLength = fileInf.Length;
reqFTP.EnableSsl = true;
ServicePoint currentServicePoint = reqFTP.ServicePoint;
currentServicePoint.ConnectionLimit = 1024;
int buffLength = 2048;
byte[] buff = new byte[buffLength];
int contentLen;
FileStream fs = fileInf.OpenRead();
Int64 upload_size = 0;
try
{
Stream strm = reqFTP.GetRequestStream();
contentLen = fs.Read(buff, 0, buffLength);
while (contentLen != 0)
{
double process = upload_size / (double)fileInf.Length;
if (process > 1) { process = 1; }
var progress = new FileTransferProgressEventArgs()
{
Cancel = false,
LocalPath = localPath,
FileProgress = process,
};
FileTransferProgress?.Invoke(this, progress);
if (progress.Cancel) { break; }
upload_size += buffLength;
strm.Write(buff, 0, contentLen);
contentLen = fs.Read(buff, 0, buffLength);
}
strm.Close();
fs.Close();
var progress2 = new FileTransferProgressEventArgs()
{
Cancel = false,
LocalPath = localPath,
FileProgress = 1,
IsComplete=true
};
FileTransferProgress?.Invoke(this, progress2);
return 1;
}
catch (Exception ex)
{
ErrorMsg = ex.Message;
return -1;
}
}
public string ErrorMsg { get; set; } = "";
/// <summary>
/// 文件传输事件
/// </summary>
public event FileTransferProgressEventHandler FileTransferProgress;
~FTPFtpWeb()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
Close();
// If disposing equals true, dispose all managed
// and unmanaged resources.
if (disposing)
{
// Dispose managed resources.
}
// Release unmanaged resources. If disposing is false,
// only the following code is executed.
// Note that this is not thread safe.
// Another thread could start disposing the object
// after the managed resources are disposed,
// but before the disposed flag is set to true.
// If thread safety is necessary, it must be
// implemented by the client.
}
disposed = true;
}
}
}
@@ -0,0 +1,361 @@
using GameBackup3H3.DbOp;
using ryCommon;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WinSCP;
namespace FTPop
{
/// <summary>
/// FTP管理
/// </summary>
public class FTPWinSCP : IFTP, IDisposable
{
private bool disposed = false;
readonly Session session = new Session();
public string CurRemoteFolder { get; private set; } = "";
private FTPInfo _ftpinfo = null;
/// <summary>
/// 打开FTP
/// </summary>
/// <param name="ftpinfo"></param>
public int Open(FTPInfo ftpinfo)
{
if(ftpinfo==null)
{
return -1;
}
_ftpinfo = ftpinfo;
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = ftpinfo.IP,
PortNumber = ftpinfo.Port,
UserName = ftpinfo.UserName,
Password = ftpinfo.Pwd,
};
CurRemoteFolder = ftpinfo.RemoteDir;
if (ftpinfo.Encrypt > 0)
{
sessionOptions.FtpSecure = ftpinfo.Encrypt == 2 ? FtpSecure.Explicit : FtpSecure.Implicit;
sessionOptions.GiveUpSecurityAndAcceptAnyTlsHostCertificate = true;
}
else
{
sessionOptions.FtpSecure = FtpSecure.None;
}
if (FileTransferProgress != null)
{
session.FileTransferProgress += Session_FileTransferProgress; ;
}
try
{
session.Open(sessionOptions);
if (session.Opened)
{
return 1;
}
else
{
return -1;
}
}
catch(Exception ex)
{
ErrorMsg = ex.Message;
return -2;
}
}
/// <summary>
/// ftp是否打开着
/// </summary>
public bool IsOpen
{
get {
return session.Opened;
}
}
/// <summary>
/// ftp是否打开着
/// </summary>
public int ReConnect
{
get { return Open(_ftpinfo); }
}
private void Session_FileTransferProgress(object sender, WinSCP.FileTransferProgressEventArgs e)
{
var progress= new FileTransferProgressEventArgs()
{
Cancel = e.Cancel,
LocalPath = e.FileName,
FileProgress=e.FileProgress,
IsComplete=e.FileProgress==1
};
FileTransferProgress?.Invoke(this, progress);
if (progress.Cancel) { e.Cancel = progress.Cancel; }
}
/// <summary>
/// 关闭FTP
/// </summary>
/// <returns></returns>
public int Close()
{
try
{
if (session.Opened)
{ session.Close(); }
session?.Dispose();
return 1;
}
catch { return 0; }
}
/// <summary>
/// 移除文件
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public int RemoveFiles(string remotePath)
{
var result= session.RemoveFiles(remotePath);
return result.IsSuccess?1:-1;
}
/// <summary>
/// 移动文件
/// </summary>
/// <param name="fromPath"></param>
/// <param name="toPath"></param>
/// <returns></returns>
public int MoveFile(string fromPath, string toPath)
{
session.MoveFile(fromPath, toPath);
return 1;
}
/// <summary>
/// 移动文件
/// </summary>
/// <param name="DirPath"></param>
/// <returns></returns>
public int CreateDir(string DirPath)
{
try
{
session.CreateDirectory(DirPath);
return 1;
}
catch
{
return -1;
}
}
/// <summary>
/// 文件是否存在
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public bool FileExists(string remotePath)
{
if(remotePath.Length==0 || remotePath == "/") { return true; }
try
{
return session.FileExists(remotePath);
}
catch { return false; }
}
/// <summary>
/// 文件大小
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public Int64 FileSize(string remotePath)
{
try
{
return session.GetFileInfo(remotePath).Length;
}
catch { return -1; }
}
/// <summary>
/// 文件最后修改时间
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public DateTime FileLastWriteTime(string remotePath)
{
try
{
return session.GetFileInfo(remotePath).LastWriteTime;
}
catch { return new DateTime(2000,1,1); }
}
/// <summary>
/// 文件信息
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
public RemoteFileInfo GetFileInfo(string remotePath)
{
try
{
var info = session.GetFileInfo(remotePath);
return new RemoteFileInfo() { LastWriteTime = info.LastWriteTime, Length = info.Length, Name = info.Name, IsDirectory = info.IsDirectory };
}
catch { return new RemoteFileInfo(); }
}
/// <summary>
/// 显示文件夹列表
/// </summary>
/// <param name="CurFolder"></param>
/// <returns></returns>
public List<RemoteFileInfo> ListDirectory(string CurFolder, out string error)
{
error = "";
var list = new List<RemoteFileInfo>();
try
{
var result = session.ListDirectory(CurFolder);
for (int i = 0; i < result.Files.Count; i++)
{
var file = result.Files[i];
list.Add(new RemoteFileInfo()
{
FullName = file.FullName,
IsDirectory = file.IsDirectory,
Name = file.Name,
Length = file.Length,
LastWriteTime = file.LastWriteTime
});
}
}
catch(Exception ex)
{
error = ex.Message;
}
return list;
}
/// <summary>
/// 上传
/// </summary>
/// <param name="localPath"></param>
/// <param name="remotePath"></param>
/// <returns></returns>
public int Upload(string localPath, string remotePath)
{
try
{
TransferOptions transferOptions = new TransferOptions
{
TransferMode = TransferMode.Binary,
OverwriteMode= OverwriteMode.Overwrite,
};
TransferOperationResult transferResult;
transferResult =
session.PutFiles(localPath, remotePath, false, transferOptions);
//Throw on any error
transferResult.Check();
if (transferResult.IsSuccess)
{
if (FileSize(remotePath) == RyFiles.GetFileSize(localPath))
{
return 1;
}
else
{
ErrorMsg = "文件不完整。";
return -3;
}
}
else
{
return -2;
}
}
catch(Exception ex)
{
ErrorMsg = ex.Message;
return -1;
}
}
/// <summary>
/// 下载
/// </summary>
/// <param name="remotePath"></param>
/// <param name="localPath"></param>
/// <returns></returns>
public int Download(string remotePath, string localPath)
{
try
{
TransferOptions transferOptions = new TransferOptions
{
TransferMode = TransferMode.Binary,
OverwriteMode = OverwriteMode.Overwrite
};
TransferOperationResult transferResult;
transferResult =
session.GetFiles(remotePath, localPath, false, transferOptions);
//Throw on any error
transferResult.Check();
if (transferResult.IsSuccess)
{
if (FileSize(remotePath) == RyFiles.GetFileSize(localPath))
{
return 1;
}
else
{
ErrorMsg = "文件不完整。";
return -3;
}
}
else
{
return -2;
}
}
catch (Exception ex)
{
ErrorMsg = ex.Message;
return -1;
}
}
public string ErrorMsg { get; set; } = "";
/// <summary>
/// 文件传输事件
/// </summary>
public event FileTransferProgressEventHandler FileTransferProgress;
~FTPWinSCP()
{
Dispose(false);
}
public void Dispose()
{
Dispose(true);
GC.SuppressFinalize(this);
}
protected virtual void Dispose(bool disposing)
{
if (!this.disposed)
{
Close();
// If disposing equals true, dispose all managed
// and unmanaged resources.
if (disposing)
{
// Dispose managed resources.
session.Dispose();
}
// Release unmanaged resources. If disposing is false,
// only the following code is executed.
// Note that this is not thread safe.
// Another thread could start disposing the object
// after the managed resources are disposed,
// but before the disposed flag is set to true.
// If thread safety is necessary, it must be
// implemented by the client.
}
disposed = true;
}
}
}
@@ -0,0 +1,362 @@
namespace GameBackup3H3.DbOp
{
partial class FrmAddFTP
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmAddFTP));
this.BtnCancel = new ryControls.ButtonEx();
this.BtnOK = new ryControls.ButtonEx();
this.CbbEncryption = new ryControls.RyComboBox();
this.label10 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.TxtRemoteDir = new ryControls.TextBoxEx2();
this.label5 = new System.Windows.Forms.Label();
this.TxtPort = new ryControls.TextBoxEx2();
this.label4 = new System.Windows.Forms.Label();
this.TxtPwd = new ryControls.TextBoxEx2();
this.label3 = new System.Windows.Forms.Label();
this.TxtUserName = new ryControls.TextBoxEx2();
this.label2 = new System.Windows.Forms.Label();
this.TxtHost = new ryControls.TextBoxEx2();
this.label1 = new System.Windows.Forms.Label();
this.TxtName = new ryControls.TextBoxEx2();
this.label7 = new System.Windows.Forms.Label();
this.TxtDes = new ryControls.TextBoxEx2();
this.SuspendLayout();
//
// BtnCancel
//
this.BtnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BtnCancel.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnCancel.Location = new System.Drawing.Point(358, 310);
this.BtnCancel.Name = "BtnCancel";
this.BtnCancel.Size = new System.Drawing.Size(65, 27);
this.BtnCancel.TabIndex = 5;
this.BtnCancel.Text = "取消";
this.BtnCancel.UseVisualStyleBackColor = true;
this.BtnCancel.Click += new System.EventHandler(this.BtnCancel_Click);
//
// BtnOK
//
this.BtnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BtnOK.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.BtnOK.Location = new System.Drawing.Point(287, 310);
this.BtnOK.Name = "BtnOK";
this.BtnOK.Size = new System.Drawing.Size(65, 27);
this.BtnOK.TabIndex = 4;
this.BtnOK.Text = "确定";
this.BtnOK.UseVisualStyleBackColor = true;
this.BtnOK.Click += new System.EventHandler(this.BtnOK_Click);
//
// CbbEncryption
//
this.CbbEncryption.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.CbbEncryption.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CbbEncryption.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CbbEncryption.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.CbbEncryption.FormattingEnabled = true;
this.CbbEncryption.Items.AddRange(new object[] {
"不加密",
"TLS/SSL Implicit 隐式加密",
"TLS/SSL Explicit 显式加密"});
this.CbbEncryption.Location = new System.Drawing.Point(76, 41);
this.CbbEncryption.Name = "CbbEncryption";
this.CbbEncryption.Size = new System.Drawing.Size(348, 24);
this.CbbEncryption.TabIndex = 44;
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(13, 45);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(53, 12);
this.label10.TabIndex = 43;
this.label10.Text = "加密方式";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(17, 142);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 12);
this.label6.TabIndex = 40;
this.label6.Text = "远程目录";
//
// TxtRemoteDir
//
this.TxtRemoteDir.BackColor = System.Drawing.Color.White;
this.TxtRemoteDir.EmptyText = "";
this.TxtRemoteDir.Location = new System.Drawing.Point(76, 134);
this.TxtRemoteDir.MaxLength = 999999999;
this.TxtRemoteDir.Multiline = false;
this.TxtRemoteDir.Name = "TxtRemoteDir";
this.TxtRemoteDir.OnlyNumeric = false;
this.TxtRemoteDir.PasswordChar = '\0';
this.TxtRemoteDir.ReadOnly = false;
this.TxtRemoteDir.SelectedText = "";
this.TxtRemoteDir.SelectionLength = 0;
this.TxtRemoteDir.SelectionStart = 0;
this.TxtRemoteDir.Size = new System.Drawing.Size(348, 25);
this.TxtRemoteDir.TabIndex = 39;
this.TxtRemoteDir.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtRemoteDir.ToolTip = "";
this.TxtRemoteDir.WordWrap = true;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(323, 80);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(29, 12);
this.label5.TabIndex = 38;
this.label5.Text = "端口";
//
// TxtPort
//
this.TxtPort.BackColor = System.Drawing.Color.White;
this.TxtPort.EmptyText = "";
this.TxtPort.Location = new System.Drawing.Point(358, 72);
this.TxtPort.MaxLength = 999999999;
this.TxtPort.Multiline = false;
this.TxtPort.Name = "TxtPort";
this.TxtPort.OnlyNumeric = false;
this.TxtPort.PasswordChar = '\0';
this.TxtPort.ReadOnly = false;
this.TxtPort.SelectedText = "";
this.TxtPort.SelectionLength = 0;
this.TxtPort.SelectionStart = 0;
this.TxtPort.Size = new System.Drawing.Size(66, 25);
this.TxtPort.TabIndex = 37;
this.TxtPort.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtPort.ToolTip = "";
this.TxtPort.WordWrap = true;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(242, 111);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(29, 12);
this.label4.TabIndex = 36;
this.label4.Text = "密码";
//
// TxtPwd
//
this.TxtPwd.BackColor = System.Drawing.Color.White;
this.TxtPwd.EmptyText = "";
this.TxtPwd.Location = new System.Drawing.Point(277, 103);
this.TxtPwd.MaxLength = 999999999;
this.TxtPwd.Multiline = false;
this.TxtPwd.Name = "TxtPwd";
this.TxtPwd.OnlyNumeric = false;
this.TxtPwd.PasswordChar = '*';
this.TxtPwd.ReadOnly = false;
this.TxtPwd.SelectedText = "";
this.TxtPwd.SelectionLength = 0;
this.TxtPwd.SelectionStart = 0;
this.TxtPwd.Size = new System.Drawing.Size(147, 25);
this.TxtPwd.TabIndex = 35;
this.TxtPwd.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtPwd.ToolTip = "";
this.TxtPwd.WordWrap = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(17, 111);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 34;
this.label3.Text = "用户名";
//
// TxtUserName
//
this.TxtUserName.BackColor = System.Drawing.Color.White;
this.TxtUserName.EmptyText = "";
this.TxtUserName.Location = new System.Drawing.Point(76, 103);
this.TxtUserName.MaxLength = 999999999;
this.TxtUserName.Multiline = false;
this.TxtUserName.Name = "TxtUserName";
this.TxtUserName.OnlyNumeric = false;
this.TxtUserName.PasswordChar = '\0';
this.TxtUserName.ReadOnly = false;
this.TxtUserName.SelectedText = "";
this.TxtUserName.SelectionLength = 0;
this.TxtUserName.SelectionStart = 0;
this.TxtUserName.Size = new System.Drawing.Size(160, 25);
this.TxtUserName.TabIndex = 33;
this.TxtUserName.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtUserName.ToolTip = "";
this.TxtUserName.WordWrap = true;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(17, 80);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(47, 12);
this.label2.TabIndex = 32;
this.label2.Text = "IP/主机";
//
// TxtHost
//
this.TxtHost.BackColor = System.Drawing.Color.White;
this.TxtHost.EmptyText = "";
this.TxtHost.Location = new System.Drawing.Point(76, 72);
this.TxtHost.MaxLength = 999999999;
this.TxtHost.Multiline = false;
this.TxtHost.Name = "TxtHost";
this.TxtHost.OnlyNumeric = false;
this.TxtHost.PasswordChar = '\0';
this.TxtHost.ReadOnly = false;
this.TxtHost.SelectedText = "";
this.TxtHost.SelectionLength = 0;
this.TxtHost.SelectionStart = 0;
this.TxtHost.Size = new System.Drawing.Size(241, 25);
this.TxtHost.TabIndex = 31;
this.TxtHost.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtHost.ToolTip = "";
this.TxtHost.WordWrap = true;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 17);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 12);
this.label1.TabIndex = 30;
this.label1.Text = "名称";
//
// TxtName
//
this.TxtName.BackColor = System.Drawing.Color.White;
this.TxtName.EmptyText = "";
this.TxtName.Location = new System.Drawing.Point(76, 9);
this.TxtName.MaxLength = 999999999;
this.TxtName.Multiline = false;
this.TxtName.Name = "TxtName";
this.TxtName.OnlyNumeric = false;
this.TxtName.PasswordChar = '\0';
this.TxtName.ReadOnly = false;
this.TxtName.SelectedText = "";
this.TxtName.SelectionLength = 0;
this.TxtName.SelectionStart = 0;
this.TxtName.Size = new System.Drawing.Size(348, 25);
this.TxtName.TabIndex = 29;
this.TxtName.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtName.ToolTip = "";
this.TxtName.WordWrap = true;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(17, 173);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(29, 12);
this.label7.TabIndex = 46;
this.label7.Text = "备注";
//
// TxtDes
//
this.TxtDes.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtDes.BackColor = System.Drawing.Color.White;
this.TxtDes.EmptyText = "";
this.TxtDes.Location = new System.Drawing.Point(76, 165);
this.TxtDes.MaxLength = 999999999;
this.TxtDes.Multiline = true;
this.TxtDes.Name = "TxtDes";
this.TxtDes.OnlyNumeric = false;
this.TxtDes.PasswordChar = '\0';
this.TxtDes.ReadOnly = false;
this.TxtDes.SelectedText = "";
this.TxtDes.SelectionLength = 0;
this.TxtDes.SelectionStart = 0;
this.TxtDes.Size = new System.Drawing.Size(348, 139);
this.TxtDes.TabIndex = 45;
this.TxtDes.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtDes.ToolTip = "";
this.TxtDes.WordWrap = true;
//
// FrmAddFTP
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(438, 347);
this.Controls.Add(this.label7);
this.Controls.Add(this.TxtDes);
this.Controls.Add(this.CbbEncryption);
this.Controls.Add(this.label10);
this.Controls.Add(this.label6);
this.Controls.Add(this.TxtRemoteDir);
this.Controls.Add(this.label5);
this.Controls.Add(this.TxtPort);
this.Controls.Add(this.label4);
this.Controls.Add(this.TxtPwd);
this.Controls.Add(this.label3);
this.Controls.Add(this.TxtUserName);
this.Controls.Add(this.label2);
this.Controls.Add(this.TxtHost);
this.Controls.Add(this.label1);
this.Controls.Add(this.TxtName);
this.Controls.Add(this.BtnCancel);
this.Controls.Add(this.BtnOK);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.Name = "FrmAddFTP";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "新增";
this.Load += new System.EventHandler(this.FrmAddFTP_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private ryControls.ButtonEx BtnCancel;
private ryControls.ButtonEx BtnOK;
private ryControls.RyComboBox CbbEncryption;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.Label label6;
private ryControls.TextBoxEx2 TxtRemoteDir;
private System.Windows.Forms.Label label5;
private ryControls.TextBoxEx2 TxtPort;
private System.Windows.Forms.Label label4;
private ryControls.TextBoxEx2 TxtPwd;
private System.Windows.Forms.Label label3;
private ryControls.TextBoxEx2 TxtUserName;
private System.Windows.Forms.Label label2;
private ryControls.TextBoxEx2 TxtHost;
private System.Windows.Forms.Label label1;
private ryControls.TextBoxEx2 TxtName;
private System.Windows.Forms.Label label7;
private ryControls.TextBoxEx2 TxtDes;
}
}
@@ -0,0 +1,100 @@
using ryCommon;
using ryCommonDb;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using 开发辅助工具.Manager;
namespace GameBackup3H3.DbOp
{
public partial class FrmAddFTP : Form
{
public ModalForm mr = null;
public string tableName = "FTP";
public int isAdd = 1;
public string selectId = "-1";
public FrmAddFTP()
{
InitializeComponent();
CbbEncryption.SelectedIndex = 0;
}
#region 需要修改
public void GetInfo(string id)
{
selectId = id;
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData(tableName, id);
if (mydb.HaveData(ds))
{
DataRow reader = ds.Tables[0].Rows[0];
#region 读取信息
TxtName.Text = reader["name"].ToString();
TxtHost.Text = reader["ip"].ToString();
TxtPort.Text = reader["port"].ToString();
TxtRemoteDir.Text = reader["remoteDir"].ToString();
TxtUserName.Text = reader["username"].ToString();
TxtPwd.Text = reader["pwd"].ToString();
CbbEncryption.SelectedIndex = reader["encrypt"].ToInt(0,2,0);
TxtDes.Text = reader["des"].ToString();
#endregion
}
}
db.Free();
}
private void BtnOK_Click(object sender, EventArgs e)
{
if (TxtName.Text == "")
{
MessageBox.Show("名称不能为空。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
return;
}
RyQuickSQL mySQL = new RyQuickSQL(tableName);
mySQL.AddField("name", TxtName.Text);
mySQL.AddField("ip", TxtHost.Text);
mySQL.AddField("port", TxtPort.Text.ToInt());
mySQL.AddField("remoteDir", TxtRemoteDir.Text);
mySQL.AddField("username", TxtUserName.Text);
mySQL.AddField("pwd", TxtPwd.Text);
mySQL.AddField("encrypt", CbbEncryption.SelectedIndex);
mySQL.AddField("des", TxtDes.Text);
//DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
if (isAdd >= 1)
{
mySQL.AddField("addTime",DateTime.Now);
mySQL.AddField("editTime", DateTime.Now);
db.ExecuteNonQuery(mySQL.GetInsertSQL(), db.GetParameter(mySQL));
}
else
{
mySQL.AddField("editTime", DateTime.Now);
db.ExecuteNonQuery(mySQL.GetUpdateSQL() + " where id=" + selectId, db.GetParameter(mySQL));
}
}
db.Free();
ModalForm.SetDialogResult(this, mr, DialogResult.OK);
}
#endregion
private void BtnCancel_Click(object sender, EventArgs e)
{
ModalForm.SetDialogResult(this, mr, DialogResult.Cancel);
}
private void FrmAddFTP_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIABKAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAAARn
QU1BAACxjwv8YQUAAAIBSURBVFhHxZexTsMwEIY7lJdgZS9CYmAAVAk23oChAwOvwNIJiU5MwMSMBCNs
ZSqVWJGanYGxlKEValloMf5cJ7qmbnCVhJz0S9H5fP+f2Hd2Sr72MVKrGsfdobp5H6pAo6+hLHgOGCOG
WDstvXW/1JZOfCfIvMAc5to0y1urpcq9kbp0JV8G5CCXTetnemJFoyMTpQS5KjZ9svU+1bYOHojJWWFA
bkvjNh3Em+dBHoLc7i/BOunBLD/7InSceyKLDecLuCzt1CgXV2CemClRWefXLxNVexgbNJ4nM2i+/qiT
+mmE3eqegfQ1zi+cfkkO4DTkdC05gIC1q28nEFAuryQCAXGfSwAwHZPWKZ2hgHpr+sZx3DefIqxvbBpI
XyjgsHYU+RCwU903z5ILbj4/vT1ytt9+jACESL8LJAXSB0n8rXnGFxcAN7XPwRI5Uwt4bHsL0AgQIE+1
aAkWbUIZ6xJwZpcgvgmBQ0AfATPOvzahjE0SIAG5jJGYE5DHEiRhbgn+WYBZgtw3YQKC7MtwCQGmDOON
CAEHt+NUAvD5CDCNiHYonZQKk/NAvAzhNucBB4MUwCfMA1IAnIYck8cxQXkiEhC/MRd6IcEKv5JherC4
S2lohV7LQ9PBxf2YhMY6ZbExybFwzX2McpF9whfMmSu1NEbXonXSvzVBRr/npdIvW6FdJBbwQIAAAAAA
SUVORK5CYII=
</value>
</data>
</root>
@@ -0,0 +1,101 @@
namespace 开发辅助工具.Manager.FTP
{
partial class FrmDownProg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmDownProg));
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.label1 = new System.Windows.Forms.Label();
this.ProgAll = new System.Windows.Forms.ProgressBar();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(12, 39);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(368, 32);
this.progressBar1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(83, 12);
this.label1.TabIndex = 1;
this.label1.Text = "正在下载中...";
//
// ProgAll
//
this.ProgAll.Location = new System.Drawing.Point(12, 101);
this.ProgAll.Name = "ProgAll";
this.ProgAll.Size = new System.Drawing.Size(368, 32);
this.ProgAll.TabIndex = 2;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 86);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(53, 12);
this.label2.TabIndex = 3;
this.label2.Text = "全部进度";
//
// FrmDownProg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(392, 166);
this.Controls.Add(this.label2);
this.Controls.Add(this.ProgAll);
this.Controls.Add(this.label1);
this.Controls.Add(this.progressBar1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmDownProg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "下载中...";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmDownProg_FormClosing);
this.Shown += new System.EventHandler(this.FrmDownProg_Shown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ProgressBar ProgAll;
private System.Windows.Forms.Label label2;
}
}
@@ -0,0 +1,151 @@
using DiffPlex.Model;
using GameBackup3H3.DbOp;
using ryCommon;
using SuperDesign.Manager.FTP;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 开发辅助工具.Manager.FTP
{
public partial class FrmDownProg : Form
{
public FrmDownProg()
{
InitializeComponent();
}
public List<UploadInfo> DownList { get; set; } = new List<UploadInfo>();
private void FrmDownProg_FormClosing(object sender, FormClosingEventArgs e)
{
if(e.CloseReason== CloseReason.UserClosing) { e.Cancel = true; }
}
private void FrmDownProg_Shown(object sender, EventArgs e)
{
ProgAll.Maximum = DownList.Count;
Thread th = new Thread(Start);
th.Start();
void Start()
{
var error = 0;
for (int i = 0; i < DownList.Count; i++)
{
var item = DownList[i];
FTPop.FTPWinSCP ftp = (FTPop.FTPWinSCP)FTPManger.GetFTP(item.FtpInfo, out var result);
FTPManger.FileTransferProgress += Ftp_FileTransferProgress;
this.Invoke(new Action(() =>
{
ProgAll.Value = i;
label1.Text = "正在登录FTP...";
}));
if (result == 1)
{
this.Invoke(new Action(() =>
{
label1.Text = "正在下载文件...";
}));
if (!ftp.FileExists(item.RemotePath))
{
error++;
this.Invoke(new Action(() =>
{
MessageBox.Show("远程文件不存在=>" + item.RemotePath, "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
continue;
}
else
{
if (item.LocalPath.Length > 0)
{
var remote_fileinfo = ftp.GetFileInfo(item.RemotePath);
if (remote_fileinfo.LastWriteTime != DateTime.MinValue)
{
bool goto_next = false;
if (remote_fileinfo.LastWriteTime.ToInt64() < RyFiles.GetFileDate(item.LocalPath).LastWriteTime.ToInt64())
{
this.Invoke(new Action(() =>
{
switch (MessageBox.Show("当前本地文件的修改日期比远程服务器新,是否要替换?\r\n\r\n" + item.LocalPath, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
error++;
goto_next = true;
break;
}
}));
}
else if (RyFiles.GetFileDate(item.LocalPath).LastWriteTime.ToInt64() == remote_fileinfo.LastWriteTime.ToInt64())
{
if (RyFiles.GetFileSize(item.LocalPath) != remote_fileinfo.Length)
{
this.Invoke(new Action(() =>
{
switch (MessageBox.Show("当前本地文件与服务器文件日期一致,但大小不一致,是否要替换?\r\n\r\n本地:" + RyFiles.GetFileSizeStr(item.LocalPath) + "=>服务器:" + RyFiles.GetFileSizeStr(remote_fileinfo.Length), "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
error++;
goto_next = true;
break;
}
}));
}
}
if (goto_next) { continue; }
}
}
}
if (ftp.Download(item.RemotePath, item.LocalPath) == 1)
{
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("下载失败=>" + item.RemotePath + "\r\n" + ftp.ErrorMsg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
error++;
}));
}
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("FTP登录失败=>"+item.LocalPath, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
error++;
}));
}
FTPManger.FileTransferProgress -= Ftp_FileTransferProgress;
}
this.Invoke(new Action(() =>
{
ProgAll.Value = ProgAll.Maximum;
if (error == 0)
{
DialogResult = DialogResult.OK;
}
else
{
DialogResult = DialogResult.No;
}
}));
}
}
private void Ftp_FileTransferProgress(object sender, FTPop.FileTransferProgressEventArgs e)
{
this.Invoke(new Action(() =>
{
progressBar1.Value = (e.FileProgress*100).ToInt();
}));
}
}
}
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIAD4AgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAAARn
QU1BAACxjwv8YQUAAAKvSURBVFhH7VY9aBRBFN5CMLt7atRCbGzsJE20iKSy8w/EJpWNIAQba7Gy0cqf
QggasjubC2qRIp2BVAcSgogG/EELBREEj4SAYXf2LtX5vdk3m72925s7bsv74ONu33vz3jdvZnfGGmGE
QTG2EF6wRfzICeSaI2Qd3Mb/dTAA71u11gEOLRd2EM+gcA0FWwZuOJ68ysPKARXvUugvuIlZf83ZE1I3
yoAbRHdzyeedRXmO3QnmtirozrQjompb7LAicjP/4/jyMrsKAcGXEPdjaBEYeB0JtiiJ7csQ6zrJLgXa
jFmyWQHdmEI3dhIR+J2XJ9llBtTfckX0Np0B6IrGPXanoKLanxdAQJ5r6Xg/usnm3rD96IkelOE7drfB
JIAA3yr50ZHXbCoG1ntJJwQ/09rZYneK3R3oU8Asx+xAxOOiOCp+RydD4bWxauMUuwrRjwBCmpfpCrnM
rgSHvd1jmV37gc1G9C0AX0jM/ruOJbaJoFZnnLNsNqJfARro8nnEvtFjMOmHyoEH/fGoK0OfGFSABgrP
8bio4u1NkID3yoC155iuoCJ5ciIlIE8e1oGDi83TGJN8X3CoQUAcpQ8GQP0zXbSQvnzO4YVAzRUVS5PG
ny/0QK8h+3uCNlBaLE8/WuWwnshMpE4CXvDgT+w3whVx25eS+ZHdRmQEbNNbcFsn6bV2WRx59e8okuwf
OEL+PlRtHWe3EZklWLecqpzEQ4MM2Ac1jjGi4oUT6pASUoJn2WxEsgljGkPCfWV0vPABG2gTGY9cDVc0
Lw56+0GNTV0Lh9QNZRwPWuPYA99SEbh0oBvTylkSKmLvDFq+f3vK3xNguALHrzRAMQ5pWYYlcv0Em9nc
XLYd7kJ0Incqlk4SxOWKAREzuJQ8RQc2uiUZmHjF7SB62dH2EUawLOs/Afw6gsg7dkcAAAAASUVORK5C
YII=
</value>
</data>
</root>
@@ -0,0 +1,431 @@
namespace SuperDesign.Manager.FTP
{
partial class FrmFTPBrowser
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmFTPBrowser));
this.objectListView1 = new BrightIdeasSoftware.FastObjectListView();
this.OlvFileName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvFileSize = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvFileType = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvLastWriteTime = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.刷新列表ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.查看历史记录ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.打开同位置本地文件ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.imageListSmall = new System.Windows.Forms.ImageList(this.components);
this.CbbMatch = new ryControls.RyComboBox();
this.TxtSearch = new ryControls.TextBoxEx2();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.PnlState = new System.Windows.Forms.Panel();
this.label1 = new System.Windows.Forms.Label();
this.TxtFtpPath = new ryControls.TextBoxEx2();
this.MenuForm = new System.Windows.Forms.ContextMenuStrip(this.components);
this.重命名ToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.BtnMustUpdate = new ryControls.ButtonEx();
this.panel1 = new System.Windows.Forms.Panel();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new ryControls.Controls.LableX();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.BtnUp = new ryControls.ButtonEx();
((System.ComponentModel.ISupportInitialize)(this.objectListView1)).BeginInit();
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.PnlState.SuspendLayout();
this.MenuForm.SuspendLayout();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// objectListView1
//
this.objectListView1.AllColumns.Add(this.OlvFileName);
this.objectListView1.AllColumns.Add(this.OlvFileSize);
this.objectListView1.AllColumns.Add(this.OlvFileType);
this.objectListView1.AllColumns.Add(this.OlvLastWriteTime);
this.objectListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.objectListView1.CellEditUseWholeCell = false;
this.objectListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.OlvFileName,
this.OlvFileSize,
this.OlvFileType,
this.OlvLastWriteTime});
this.objectListView1.ContextMenuStrip = this.contextMenuStrip1;
this.objectListView1.Cursor = System.Windows.Forms.Cursors.Default;
this.objectListView1.FullRowSelect = true;
this.objectListView1.HideSelection = false;
this.objectListView1.LargeImageList = this.imageListSmall;
this.objectListView1.Location = new System.Drawing.Point(1, 53);
this.objectListView1.MultiSelect = false;
this.objectListView1.Name = "objectListView1";
this.objectListView1.RowHeight = 25;
this.objectListView1.ShowGroups = false;
this.objectListView1.Size = new System.Drawing.Size(278, 455);
this.objectListView1.SmallImageList = this.imageListSmall;
this.objectListView1.TabIndex = 0;
this.objectListView1.UseCompatibleStateImageBehavior = false;
this.objectListView1.UseFiltering = true;
this.objectListView1.View = System.Windows.Forms.View.Details;
this.objectListView1.VirtualMode = true;
this.objectListView1.BeforeSorting += new System.EventHandler<BrightIdeasSoftware.BeforeSortingEventArgs>(this.ObjectListView1_BeforeSorting);
this.objectListView1.SelectionChanged += new System.EventHandler(this.ObjectListView1_SelectionChanged);
this.objectListView1.DoubleClick += new System.EventHandler(this.ObjectListView1_DoubleClick);
//
// OlvFileName
//
this.OlvFileName.Tag = "FileName";
this.OlvFileName.Text = "文件名";
this.OlvFileName.Width = 200;
//
// OlvFileSize
//
this.OlvFileSize.Tag = "FileSize";
this.OlvFileSize.Text = "文件大小";
this.OlvFileSize.Width = 90;
//
// OlvFileType
//
this.OlvFileType.Tag = "FileType";
this.OlvFileType.Text = "文件类型";
this.OlvFileType.Width = 90;
//
// OlvLastWriteTime
//
this.OlvLastWriteTime.Tag = "LastWriteTime";
this.OlvLastWriteTime.Text = "最后写入时间";
this.OlvLastWriteTime.Width = 200;
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.刷新列表ToolStripMenuItem,
this.toolStripMenuItem1,
this.查看历史记录ToolStripMenuItem,
this.打开同位置本地文件ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(185, 76);
//
// 刷新列表ToolStripMenuItem
//
this.刷新列表ToolStripMenuItem.Name = "刷新列表ToolStripMenuItem";
this.刷新列表ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.刷新列表ToolStripMenuItem.Text = "刷新列表";
this.刷新列表ToolStripMenuItem.Click += new System.EventHandler(this.刷新列表ToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(181, 6);
//
// 查看历史记录ToolStripMenuItem
//
this.查看历史记录ToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("查看历史记录ToolStripMenuItem.Image")));
this.查看历史记录ToolStripMenuItem.Name = "查看历史记录ToolStripMenuItem";
this.查看历史记录ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.查看历史记录ToolStripMenuItem.Text = "查看历史记录";
this.查看历史记录ToolStripMenuItem.Click += new System.EventHandler(this.查看历史记录ToolStripMenuItem_Click);
//
// 打开同位置本地文件ToolStripMenuItem
//
this.打开同位置本地文件ToolStripMenuItem.Name = "打开同位置本地文件ToolStripMenuItem";
this.打开同位置本地文件ToolStripMenuItem.Size = new System.Drawing.Size(184, 22);
this.打开同位置本地文件ToolStripMenuItem.Text = "打开同位置本地文件";
this.打开同位置本地文件ToolStripMenuItem.Click += new System.EventHandler(this.打开同位置本地文件ToolStripMenuItem_Click);
//
// imageListSmall
//
this.imageListSmall.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit;
this.imageListSmall.ImageSize = new System.Drawing.Size(16, 16);
this.imageListSmall.TransparentColor = System.Drawing.Color.Transparent;
//
// CbbMatch
//
this.CbbMatch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.CbbMatch.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawFixed;
this.CbbMatch.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.CbbMatch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CbbMatch.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.CbbMatch.FormattingEnabled = true;
this.CbbMatch.Items.AddRange(new object[] {
"任意文本",
"前缀",
"正则表达式"});
this.CbbMatch.Location = new System.Drawing.Point(185, 1);
this.CbbMatch.Name = "CbbMatch";
this.CbbMatch.Size = new System.Drawing.Size(94, 24);
this.CbbMatch.TabIndex = 12;
this.CbbMatch.SelectedIndexChanged += new System.EventHandler(this.CbbMatch_SelectedIndexChanged);
//
// TxtSearch
//
this.TxtSearch.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtSearch.BackColor = System.Drawing.Color.White;
this.TxtSearch.EmptyText = "请输入搜索内容";
this.TxtSearch.Location = new System.Drawing.Point(1, 1);
this.TxtSearch.MaxLength = 999999999;
this.TxtSearch.Multiline = false;
this.TxtSearch.Name = "TxtSearch";
this.TxtSearch.OnlyNumeric = false;
this.TxtSearch.PasswordChar = '\0';
this.TxtSearch.ReadOnly = false;
this.TxtSearch.SelectedText = "";
this.TxtSearch.SelectionLength = 0;
this.TxtSearch.SelectionStart = 0;
this.TxtSearch.Size = new System.Drawing.Size(178, 24);
this.TxtSearch.TabIndex = 11;
this.TxtSearch.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtSearch.ToolTip = "";
this.TxtSearch.WordWrap = true;
this.TxtSearch.TextChanged2 += new System.EventHandler(this.TxtSearch_TextChanged2);
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(121, 21);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBox1.TabIndex = 13;
this.pictureBox1.TabStop = false;
//
// PnlState
//
this.PnlState.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.PnlState.BackColor = System.Drawing.Color.White;
this.PnlState.Controls.Add(this.label1);
this.PnlState.Controls.Add(this.pictureBox1);
this.PnlState.Location = new System.Drawing.Point(1, 216);
this.PnlState.Name = "PnlState";
this.PnlState.Size = new System.Drawing.Size(281, 98);
this.PnlState.TabIndex = 14;
this.PnlState.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(101, 67);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(77, 12);
this.label1.TabIndex = 14;
this.label1.Text = "正在加载....";
//
// TxtFtpPath
//
this.TxtFtpPath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.TxtFtpPath.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(192)))));
this.TxtFtpPath.EmptyText = "";
this.TxtFtpPath.Location = new System.Drawing.Point(35, 28);
this.TxtFtpPath.MaxLength = 999999999;
this.TxtFtpPath.Multiline = false;
this.TxtFtpPath.Name = "TxtFtpPath";
this.TxtFtpPath.OnlyNumeric = false;
this.TxtFtpPath.PasswordChar = '\0';
this.TxtFtpPath.ReadOnly = true;
this.TxtFtpPath.SelectedText = "";
this.TxtFtpPath.SelectionLength = 0;
this.TxtFtpPath.SelectionStart = 0;
this.TxtFtpPath.Size = new System.Drawing.Size(244, 24);
this.TxtFtpPath.TabIndex = 15;
this.TxtFtpPath.TextAlign = System.Windows.Forms.HorizontalAlignment.Left;
this.TxtFtpPath.ToolTip = "";
this.TxtFtpPath.WordWrap = true;
//
// MenuForm
//
this.MenuForm.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.重命名ToolStripMenuItem1});
this.MenuForm.Name = "MenuForm";
this.MenuForm.Size = new System.Drawing.Size(113, 26);
//
// 重命名ToolStripMenuItem1
//
this.重命名ToolStripMenuItem1.Name = "重命名ToolStripMenuItem1";
this.重命名ToolStripMenuItem1.Size = new System.Drawing.Size(112, 22);
this.重命名ToolStripMenuItem1.Text = "重命名";
this.重命名ToolStripMenuItem1.Click += new System.EventHandler(this.重命名ToolStripMenuItem1_Click);
//
// BtnMustUpdate
//
this.BtnMustUpdate.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.BtnMustUpdate.BaseColor = System.Drawing.Color.Green;
this.BtnMustUpdate.ColorGradient = true;
this.BtnMustUpdate.Location = new System.Drawing.Point(77, 320);
this.BtnMustUpdate.Name = "BtnMustUpdate";
this.BtnMustUpdate.Size = new System.Drawing.Size(115, 48);
this.BtnMustUpdate.TabIndex = 17;
this.BtnMustUpdate.Text = "必须刷新";
this.BtnMustUpdate.UseDefSkin = false;
this.BtnMustUpdate.UseVisualStyleBackColor = true;
this.BtnMustUpdate.Visible = false;
this.BtnMustUpdate.Click += new System.EventHandler(this.BtnMustUpdate_Click);
//
// panel1
//
this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.panel1.Controls.Add(this.label7);
this.panel1.Controls.Add(this.label6);
this.panel1.Controls.Add(this.label5);
this.panel1.Controls.Add(this.label4);
this.panel1.Controls.Add(this.label3);
this.panel1.Location = new System.Drawing.Point(1, 509);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(278, 75);
this.panel1.TabIndex = 18;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(6, 58);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(89, 12);
this.label7.TabIndex = 5;
this.label7.Text = "本地文件比较新";
this.label7.Visible = false;
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.label6.Location = new System.Drawing.Point(71, 27);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(204, 31);
this.label6.TabIndex = 4;
this.label6.Text = "无";
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(71, 5);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(17, 12);
this.label5.TabIndex = 2;
this.label5.Text = "无";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(6, 27);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(59, 12);
this.label4.TabIndex = 1;
this.label4.Text = "修改时间:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(6, 5);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(59, 12);
this.label3.TabIndex = 0;
this.label3.Text = "文件大小:";
//
// BtnUp
//
this.BtnUp.BaseColor = System.Drawing.Color.Green;
this.BtnUp.ColorGradient = true;
this.BtnUp.Location = new System.Drawing.Point(2, 27);
this.BtnUp.Name = "BtnUp";
this.BtnUp.Size = new System.Drawing.Size(28, 24);
this.BtnUp.TabIndex = 19;
this.BtnUp.Text = "↑";
this.BtnUp.UseDefSkin = false;
this.BtnUp.UseVisualStyleBackColor = true;
this.BtnUp.Click += new System.EventHandler(this.BtnUp_Click);
//
// FrmFTPBrowser
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(282, 587);
this.Controls.Add(this.BtnUp);
this.Controls.Add(this.panel1);
this.Controls.Add(this.BtnMustUpdate);
this.Controls.Add(this.TxtFtpPath);
this.Controls.Add(this.PnlState);
this.Controls.Add(this.CbbMatch);
this.Controls.Add(this.TxtSearch);
this.Controls.Add(this.objectListView1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmFTPBrowser";
this.TabPageContextMenuStrip = this.MenuForm;
this.Text = "FTP浏览";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmFTPBrowser_FormClosing);
this.Load += new System.EventHandler(this.FTPBrowser_Load);
this.ResizeEnd += new System.EventHandler(this.FrmFTPBrowser_ResizeEnd);
this.SizeChanged += new System.EventHandler(this.FrmFTPBrowser_SizeChanged);
((System.ComponentModel.ISupportInitialize)(this.objectListView1)).EndInit();
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.PnlState.ResumeLayout(false);
this.PnlState.PerformLayout();
this.MenuForm.ResumeLayout(false);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private ryControls.RyComboBox CbbMatch;
private ryControls.TextBoxEx2 TxtSearch;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel PnlState;
private System.Windows.Forms.Label label1;
private ryControls.TextBoxEx2 TxtFtpPath;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ContextMenuStrip MenuForm;
private System.Windows.Forms.ToolStripMenuItem 重命名ToolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 刷新列表ToolStripMenuItem;
public BrightIdeasSoftware.FastObjectListView objectListView1;
private ryControls.ButtonEx BtnMustUpdate;
private BrightIdeasSoftware.OLVColumn OlvFileName;
private BrightIdeasSoftware.OLVColumn OlvFileSize;
private BrightIdeasSoftware.OLVColumn OlvFileType;
private BrightIdeasSoftware.OLVColumn OlvLastWriteTime;
private System.Windows.Forms.ImageList imageListSmall;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label5;
private ryControls.Controls.LableX label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.ToolStripSeparator toolStripMenuItem1;
private System.Windows.Forms.ToolStripMenuItem 打开同位置本地文件ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 查看历史记录ToolStripMenuItem;
private ryControls.ButtonEx BtnUp;
}
}
@@ -0,0 +1,678 @@
using FTPop;
using GameBackup3H3.DbOp;
using ryCommon;
using ryCommonDb;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using WinSCP;
using 开发辅助工具.Manager.FTP;
using 开发辅助工具.Manager;
using BrightIdeasSoftware;
using WeifenLuo.WinFormsUI.Docking;
using 开发辅助工具.Controls;
using 开发辅助工具.Tools.SmartEditor;
using SuperDesign.Tools.SmartEditor;
using ObjectListViewDemo;
using System.IO;
using ScintillaNET;
using DiffPlex.Model;
using ryControls.Interface;
using static System.Net.WebRequestMethods;
using ryControls;
using static VPKSoft.ScintillaLexers.LexerEnumerations;
using VPKSoft.ScintillaLexers;
namespace SuperDesign.Manager.FTP
{
public partial class FrmFTPBrowser : DockContent
{
public FrmFTPBrowser()
{
InitializeComponent();
OlvFileName.AspectGetter = (x) => { return ((FTPop.RemoteFileInfo)x)?.Name; };
OlvFileName.ImageGetter = delegate (object x) {
var item = (FTPop.RemoteFileInfo)x;
return GetImageIndex(item.IsDirectory,System.IO.Path.GetExtension(item.Name));
};
OlvFileSize.AspectGetter = (x) => { return ((FTPop.RemoteFileInfo)x).IsDirectory ? 0L : ((FTPop.RemoteFileInfo)x).Length; };
OlvFileSize.AspectToStringConverter = (rowdata, x) => { return ((long)x) == 0 ? "-" : RyFiles.GetFileSizeStr((long)x); };
OlvFileType.AspectGetter = (x) => { return ((FTPop.RemoteFileInfo)x).IsDirectory ? "文件夹" : "文件"; };
OlvLastWriteTime.AspectGetter = (x) => {
var item = (FTPop.RemoteFileInfo)x;
if(item.Name=="." || item.Name == "..") { return "-"; }
return item.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
};
procUse = true;
CbbMatch.SelectedIndex = 0;
procUse = false;
objectListView1.PrimarySortColumn = OlvFileType;
objectListView1.PrimarySortOrder = SortOrder.Descending;
objectListView1.SecondarySortColumn = OlvLastWriteTime;
objectListView1.SecondarySortOrder = SortOrder.Descending;
}
private int GetImageIndex(bool isDir,string ext)
{
string path;
if(isDir)
{
path = System.Environment.SystemDirectory;
if (imageListSmall.Images.ContainsKey("|folder"))
return imageListSmall.Images.IndexOfKey("|folder");
try
{
imageListSmall.Images.Add("|folder", ShellUtilities.GetFileIcon(path, true, true));
return imageListSmall.Images.IndexOfKey("|folder");
}
catch (ArgumentNullException)
{
return -1;
}
}
else
{
if (imageListSmall.Images.ContainsKey(ext))
return imageListSmall.Images.IndexOfKey(ext);
try
{
imageListSmall.Images.Add(ext, ShellUtilities.GetFileIcon(ext, true, true));
return imageListSmall.Images.IndexOfKey(ext);
}
catch (ArgumentNullException)
{
return -1;
}
}
}
public void TimedFilter(BrightIdeasSoftware.ObjectListView olv, string txt, int matchKind)
{
BrightIdeasSoftware.TextMatchFilter filter = null;
if (!String.IsNullOrEmpty(txt))
{
switch (matchKind)
{
case 0:
default:
filter = BrightIdeasSoftware.TextMatchFilter.Contains(olv, txt);
break;
case 1:
filter = BrightIdeasSoftware.TextMatchFilter.Prefix(olv, txt);
break;
case 2:
filter = BrightIdeasSoftware.TextMatchFilter.Regex(olv, txt);
break;
}
}
// Text highlighting requires at least a default renderer
if (olv.DefaultRenderer == null)
olv.DefaultRenderer = new BrightIdeasSoftware.HighlightTextRenderer(filter);
Stopwatch stopWatch = new Stopwatch();
stopWatch.Start();
olv.AdditionalFilter = filter;
//olv.Invalidate();
stopWatch.Stop();
}
private void FTPBrowser_Load(object sender, EventArgs e)
{
Resizes();
}
private void TxtSearch_TextChanged2(object sender, EventArgs e)
{
TimedFilter(this.objectListView1, ((ryControls.TextBoxEx2)sender).Text, this.CbbMatch.SelectedIndex);
}
public int FTPId { get; set; } = 0;
private bool IsRunning { get; set; } = false;
public FTPInfo Cur_FTPInfo
{
get;private set;
}
private void LoadFTPInfo(bool noLoadFiles=false)
{
if (IsRunning) { return; }
IsRunning = true;
TaskStartState();
Thread th = new Thread(Start);
th.Start();
void Start()
{
#region 获取ftp信息
try
{
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from Ftp where Id=" + FTPId);
if (ds.HaveData())
{
//DirectoryInfo fileSystemInfo =new DirectoryInfo("");
//fileSystemInfo.GetFileSystemInfos()
DataRow row = ds.Tables[0].Rows[0];
var FtpInfo = new GameBackup3H3.DbOp.FTPInfo()
{
Id = row["id"].ToInt(),
Name = row["name"].ToString(),
IP = row["ip"].ToString(),
Port = row["port"].ToInt(),
RemoteDir = row["remoteDir"].ToString(),
UserName = row["username"].ToString(),
Pwd = row["pwd"].ToString(),
Encrypt = row["encrypt"].ToInt(0, 2, 0),
AddTime = row["AddTime"].ToDateTime()
};
Cur_FTPInfo = FtpInfo;
if (!noLoadFiles)
{
CurFolder = FtpInfo.RemoteDir;
if (CurFolder.Length == 0) { CurFolder = "/"; }
this.Invoke(new Action(() =>
{
TxtFtpPath.Text = CurFolder;
}));
IFTP ftp = (FTPop.FTPWinSCP)FTPManger.GetFTP(FtpInfo, out var opened); ;
if (opened == 1)
{
var result = ftp.ListDirectory(CurFolder, out var error);
objectListView1.AddObjects(result);
if(error.Length>0)
{
this.Invoke(new Action(() =>
{
MessageBox.Show(error, "FTP错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("FTP打开失败。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
}
}
ds.Dispose();
}
db.Free();
}
catch (Exception ex)
{
}
#endregion
this.Invoke(new Action(() =>
{
TaskEndState();
IsRunning = false;
}));
}
}
/// <summary>
/// 初始化到指定目录
/// </summary>
/// <param name="CurFolder"></param>
public void Init(string CurFolder)
{
LoadFTPInfo(true);
if (CurFolder.Length == 0)
{
GotoDir("/");
}
else
{
GotoDir(CurFolder);
}
}
/// <summary>
/// 初始化到指定目录
/// </summary>
/// <param name="CurFolder"></param>
public void InitByNoFiles(string CurFolder)
{
LoadFTPInfo(true);
this.CurFolder = CurFolder.Length==0?"/": CurFolder;
TxtFtpPath.Text = this.CurFolder;
objectListView1.Enabled = false;
BtnUp.Enabled = false;
BtnMustUpdate.Visible = true;
}
/// <summary>
/// 初始化到默认目录
/// </summary>
public void Init()
{
LoadFTPInfo();
}
private void TaskStartState()
{
PnlState.Visible = true;
TxtSearch.Enabled = false;
CbbMatch.Enabled = false;
BtnUp.Enabled = false;
objectListView1.Enabled = false;
objectListView1.ClearObjects();
objectListView1.AllColumns[0].Text = "文件名(" + objectListView1.GetItemCount() + ")";
}
private void TaskEndState()
{
this.Invoke(new Action(() =>
{
objectListView1.AllColumns[0].Text = "文件名(" + objectListView1.GetItemCount() + ")";
PnlState.Visible = false;
objectListView1.Enabled = true;
BtnUp.Enabled = true;
TxtSearch.Enabled = true;
CbbMatch.Enabled = true;
}));
}
readonly bool procUse = false;
private void CbbMatch_SelectedIndexChanged(object sender, EventArgs e)
{
if (procUse) { return; }
TimedFilter(this.objectListView1, TxtSearch.Text, this.CbbMatch.SelectedIndex);
}
public string CurFolder { get; private set; } = "";
private void ObjectListView1_DoubleClick(object sender, EventArgs e)
{
var rfile = (FTPop.RemoteFileInfo)objectListView1.SelectedObjects[0];
if (rfile == null) { return; }
if (rfile.IsDirectory)
{
if (CurFolder.TrimEnd('/').Length == 0)
{
CurFolder = rfile.Name == ".." ? "/" : ("/" + rfile.Name);
}
else
{
if (rfile.Name == "..")
{
CurFolder = System.IO.Path.GetDirectoryName(CurFolder.TrimEnd('/')).Replace("\\", "/").Replace("//", "/");
}
else
{
CurFolder = CurFolder.TrimEnd('/').Replace("\\", "/").Replace("//", "/") + "/" + rfile.Name;
}
}
GotoDir(CurFolder);
}
else
{
if(rfile.Length>=1024*1024*10)
{
MessageBox.Show("大于10MB的FTP文件暂时不支持编辑。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
var siteinfo = new SiteInfo();
bool noedit = false;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds_site = db.ReadData("select * from Site where FtpId=" + FTPId);
if (ds_site.HaveData())
{
for (int i = 0; i < ds_site.Tables[0].Rows.Count; i++)
{
DataRow reader = ds_site.Tables[0].Rows[i];
if(rfile.FullName.IndexOfEx(reader["ftpDir"].ToString())==0)
{
var local_file = reader["localPath"].ToString().Trim('\\')+"\\"+ rfile.FullName.Replace(reader["ftpDir"].ToString(), "", true).Trim('/');
if(System.IO.File.Exists(local_file))
{
if(RyFiles.GetFileDate(local_file).LastWriteTime.ToInt64() > rfile.LastWriteTime.ToInt64())
{
switch (MessageBox.Show("当前本地文件日期比服务器上的要新,是否要编辑服务器文件?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
noedit = true;
break;
}
}
else if (RyFiles.GetFileDate(local_file).LastWriteTime.ToInt64() == rfile.LastWriteTime.ToInt64())
{
if (RyFiles.GetFileSize(local_file) != rfile.Length)
{
switch (MessageBox.Show("当前本地文件与服务器文件日期一致,但大小不一致,是否要编辑服务器文件?\r\n\r\n本地:" + RyFiles.GetFileSizeStr(local_file) + "=>服务器:" + RyFiles.GetFileSizeStr(rfile.Length), "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
noedit = true;
break;
}
}
}
}
siteinfo.Name = reader["name"].ToString();
siteinfo.LocalPath = reader["localPath"].ToString();
siteinfo.FtpDir = reader["ftpDir"].ToString();
siteinfo.FtpId = reader["ftpId"].ToInt();
siteinfo.Id = reader["Id"].ToInt();
break;
}
}
}
ds_site.Dispose();
}
db.Free();
if(!noedit)
_ = FrmMainEditor.MainEditor.OpenFTPFileByNewForm(siteinfo, rfile.FullName);
}
}
private void GotoDir(string folder_path)
{
if (IsRunning) { return; }
IsRunning = true;
TaskStartState();
new Thread(Start).Start();
void Start()
{
IFTP ftp = (FTPop.FTPWinSCP)FTPManger.GetFTP(Cur_FTPInfo, out var opened); ;
if (opened == 1)
{
this.Invoke(new Action(() =>
{
TxtFtpPath.Text = folder_path;
}));
var result = ftp.ListDirectory(folder_path, out var error);
this.Invoke(new Action(() =>
{
objectListView1.AddObjects(result);
}));
if (error.Length > 0)
{
this.Invoke(new Action(() =>
{
MessageBox.Show(error, "FTP错误", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("FTP打开失败。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}));
}
TaskEndState();
IsRunning = false;
}
}
private void 重命名ToolStripMenuItem1_Click(object sender, EventArgs e)
{
FrmTitle frm = new FrmTitle();
frm.TxtTitle.Text = Text;
frm.Text = "请输入重命名的名称";
if (frm.ShowDialog() == DialogResult.OK)
{
Text = frm.TxtTitle.Text;
}
frm.Dispose();
}
private void 刷新列表ToolStripMenuItem_Click(object sender, EventArgs e)
{
GotoDir(CurFolder);
}
private void FrmFTPBrowser_FormClosing(object sender, FormClosingEventArgs e)
{
if (IsRunning) { e.Cancel = true; }
}
private void FrmFTPBrowser_ResizeEnd(object sender, EventArgs e)
{
}
private void Resizes()
{
BtnMustUpdate.Left = objectListView1.Left + (objectListView1.Width - BtnMustUpdate.Width) / 2;
BtnMustUpdate.Top = objectListView1.Top + (objectListView1.Height - BtnMustUpdate.Height) / 2;
PnlState.Left = objectListView1.Left;
PnlState.Width = objectListView1.Width;
}
private void BtnMustUpdate_Click(object sender, EventArgs e)
{
BtnUp.Enabled = true;
objectListView1.Enabled = true;
BtnMustUpdate.Visible = false;
刷新列表ToolStripMenuItem.PerformClick();
}
private void FrmFTPBrowser_SizeChanged(object sender, EventArgs e)
{
Resizes();
}
private void ObjectListView1_SelectionChanged(object sender, EventArgs e)
{
var rfile = (FTPop.RemoteFileInfo)objectListView1.SelectedObject;
label6.ForeColor = Color.Black;
label7.Visible = false;
if (rfile == null) { label5.Text = "无"; label6.Text = "无"; return; }
if (rfile.Name == "." || rfile.Name == "..") { label5.Text = "无"; label6.Text = "无"; return; }
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds_site = db.ReadData("select * from Site where FtpId=" + FTPId);
if (ds_site.HaveData())
{
for (int i = 0; i < ds_site.Tables[0].Rows.Count; i++)
{
DataRow reader = ds_site.Tables[0].Rows[i];
if (rfile.FullName.IndexOfEx(reader["ftpDir"].ToString()) == 0)
{
var local_file = reader["localPath"].ToString().Trim('\\') + "\\" + rfile.FullName.Replace(reader["ftpDir"].ToString(), "", true).Trim('/').Replace("/","\\");
string file_dt;
if (System.IO.Directory.Exists(local_file))
{
label5.Text = "不支持文件夹";
file_dt = "[本地]" + RyFiles.GetFileDate(local_file).LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
}
else if (System.IO.File.Exists(local_file))
{
var local_filesize = RyFiles.GetFileSize(local_file);
var local_filetime =RyFiles.GetFileDate(local_file).LastWriteTime;
if (local_filetime.ToInt64() > rfile.LastWriteTime.ToInt64()) {
label7.ForeColor = Color.Red;
label7.Text = "本地文件比较新";
label7.Visible = true;
label6.ForeColor = Color.Red;
}
else if (local_filetime.ToInt64() < rfile.LastWriteTime.ToInt64()) {
label7.ForeColor = Color.Blue;
label7.Text = "FTP文件比较新";
label7.Visible = true;
label6.ForeColor = Color.Blue;
}
else if (local_filetime.ToInt64() == rfile.LastWriteTime.ToInt64())
{
if(local_filesize!= rfile.Length)
{
label7.ForeColor = Color.Red;
label7.Text = "本地与FTP文件时间一致,但大小不一致";
}
else
{
label7.ForeColor = Color.Black;
label7.Text = "本地与FTP文件时间一致";
}
label7.Visible = true;
label6.ForeColor = Color.Black;
}
string start_size_str;
if(local_filesize>rfile.Length)
{ start_size_str = "本地大"; }
else if (local_filesize == rfile.Length)
{ start_size_str = "一样大"; }
else
{ start_size_str = "远程大"; }
label5.Text = "[本地]"+RyFiles.GetFileSizeStr(local_filesize) + "=>[远程]" + RyFiles.GetFileSizeStr(rfile.Length)+ "["+start_size_str+"]";
file_dt = "[本地]" + local_filetime.ToString("yyyy-MM-dd HH:mm:ss");
}
else
{
label5.Text = "[本地]无=>[远程]" + RyFiles.GetFileSizeStr(rfile.Length);
file_dt = "[本地]无";
}
label6.Text = file_dt +
"=>\r\n[远程]" + rfile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
break;
}
}
}
ds_site.Dispose();
}
db.Free();
}
private void 打开同位置本地文件ToolStripMenuItem_Click(object sender, EventArgs e)
{
var rfile = (FTPop.RemoteFileInfo)objectListView1.SelectedObject;
if (rfile == null) { return; }
if (rfile.Name == "." || rfile.Name == "..") { return; }
bool noedit = false;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds_site = db.ReadData("select * from Site where FtpId=" + FTPId);
if (ds_site.HaveData())
{
for (int i = 0; i < ds_site.Tables[0].Rows.Count; i++)
{
DataRow reader = ds_site.Tables[0].Rows[i];
if (rfile.FullName.IndexOfEx(reader["ftpDir"].ToString()) == 0)
{
var local_file = reader["localPath"].ToString().Trim('\\') + "\\" + rfile.FullName.Replace(reader["ftpDir"].ToString(), "", true).Trim('/');
if (System.IO.File.Exists(local_file))
{
if (RyFiles.GetFileDate(local_file).LastWriteTime.ToInt64() < rfile.LastWriteTime.ToInt64())
{
switch (MessageBox.Show("当前本地文件日期比服务器上的要老,是否要编辑本地文件?", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
noedit = true;
break;
}
}
else if (RyFiles.GetFileDate(local_file).LastWriteTime.ToInt64() ==rfile.LastWriteTime.ToInt64())
{
if(RyFiles.GetFileSize(local_file)!=rfile.Length)
{
switch (MessageBox.Show("当前本地文件与服务器文件日期一致,但大小不一致,是否要编辑本地文件?\r\n\r\n本地:"+RyFiles.GetFileSizeStr(local_file)+"=>服务器:"+ RyFiles.GetFileSizeStr(rfile.Length), "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
noedit = true;
break;
}
}
}
if (!noedit) { FrmMainEditor.MainEditor.OpenFile(local_file); }
}
else if (System.IO.Directory.Exists(local_file))
{
RyFiles.OpenFile(local_file);
}
break;
}
}
}
ds_site.Dispose();
}
db.Free();
}
private void 查看历史记录ToolStripMenuItem_Click(object sender, EventArgs e)
{
var rfile = (FTPop.RemoteFileInfo)objectListView1.SelectedObject;
if (rfile == null) { return; }
if (rfile.Name == "." || rfile.Name == "..") { return; }
UploadInfo uploadinfo = null;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from Ftp where Id=" + FTPId);
if (ds.HaveData())
{
DataRow row = ds.Tables[0].Rows[0];
var FtpInfo = new GameBackup3H3.DbOp.FTPInfo()
{
Id = row["id"].ToInt(),
Name = row["name"].ToString(),
IP = row["ip"].ToString(),
Port = row["port"].ToInt(),
RemoteDir ="/",
UserName = row["username"].ToString(),
Pwd = row["pwd"].ToString(),
Encrypt = row["encrypt"].ToInt(0, 2, 0),
AddTime = row["AddTime"].ToDateTime()
};
uploadinfo = new UploadInfo()
{
FtpInfo = FtpInfo,
RemotePath = rfile.FullName,
LocalPath = Application.StartupPath + "\\UserDb\\tmp\\FTP\\" + rfile.Name
};
}
ds.Dispose();
}
db.Free();
if (uploadinfo == null) { return; }
RyFiles.DeleteFile(uploadinfo.LocalPath);
FrmDownProg frm = new FrmDownProg();
frm.DownList.Add(uploadinfo);
if (frm.ShowDialog() == DialogResult.OK)
{
LexerType CurHighliteLang;
try
{
var LexerType = VPKSoft.ScintillaLexers.HelperClasses.LexerFileExtensions.LexerTypeFromFileName(uploadinfo.LocalPath);
CurHighliteLang = LexerType;
}
catch { CurHighliteLang = LexerType.Unknown; }
FrmHistoryView frm2 = new FrmHistoryView
{
FilePath = "[FTP:"+FTPId+"]" +rfile.FullName,
Content =RyFiles.ReadAllText(uploadinfo.LocalPath),
CurHighliteLang = CurHighliteLang,
SelectModeOn = true,
TopMost = this.TopMost
};
frm2.ShowDialog();
frm2.Dispose();
RyFiles.DeleteFile(uploadinfo.LocalPath);
}
frm.Dispose();
}
private void ObjectListView1_BeforeSorting(object sender, BeforeSortingEventArgs e)
{
}
private void BtnUp_Click(object sender, EventArgs e)
{
if (BtnMustUpdate.Visible) { return; }
BtnUp.Enabled = false;
objectListView1.Enabled = false;
if (CurFolder.TrimEnd('/').Length == 0)
{
CurFolder = "/";
}
else
{
CurFolder = System.IO.Path.GetDirectoryName(CurFolder.TrimEnd('/')).Replace("\\", "/").Replace("//", "/");
}
GotoDir(CurFolder);
BtnUp.Enabled = true;
objectListView1.Enabled = true;
}
}
}
@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="查看历史记录ToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABGdBTUEAALGPC/xhBQAABFNJREFUWEft
l39sFEUUxy/xD+KP3t6eJUrVBOR291o5RZrYUG93D7FFio0/SEtRowVjNKDYEHNaQzh/hAQEW7327pqm
BFGixsQYBNveHqaJGg2B6D8GE1FJKnJ7LdEQ+Uf+Gd8b3p17u3PttZH/+CQ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1Cbuv9epgtbLmDi2+3kv/58tanFKY6HC+jc/hdp2bYiNn9TkGndaS2c2H1cZO9dvJgmS9z
/stbKET1uF7Fk2AW2MCT7+/8+8XRPtY59BJbteMJuAvWsLq2u1ntffV8w+0+9UmZ+EB+bP4PVAT3A7yS
h0F8mpIpM6VLZw/1P892fLe/TBjujQsp+9jM74C54vzPqGesv7f/zJFTZaKXbRK+hunk6dEFNOzKksmP
Lc5M5TrhbbAtNWUtp+arzILP9y8yNz1BYtUGSQAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="imageListSmall.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>316, 19</value>
</metadata>
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
R0lGODlhIAAgAOYAAP////39/f7+/vz8/Pr6+vf39/n5+fv7+/T09Pb29vHx8efn5/j4+OHh4fX19e3t
7eTk5PLy8re3t7q6uvDw8Orq6rS0tNTU1L29vcrKyuvr68TExO/v79fX193d3dDQ0PPz87Kysu7u7tra
2ujo6Ozs7M3Nzenp6bW1tbi4uOPj48fHx+Xl5bu7u9XV1d7e3tbW1r+/v9jY2NPT09HR0ebm5sDAwLa2
ts/Pz8LCwsjIyNzc3MbGxuDg4M7OzsXFxby8vMHBwd/f39vb28nJybOzs9LS0tnZ2cvLy8zMzOLi4rm5
ucPDw76+vgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQE
CgAAACwAAAAAIAAgAAAH/4AAgoOEhYaHi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zYPMAxp8KCIhiZQZo0Dc2cN5sFjeADjdevZQgIQLt2AMmdFnzYzZsGgNrTVhf2YAKHceMjALgU
5ABCCQTKCyvAYcKEj+tJGuw88CLEhBQ+WDAMBgNJkiTVrT8YBCFFkRAhbsT48PURzxE8MmQwf95FK7Am
hFCEBQSGYIELFfzn1AEKjKCDDkTohwQSRDQlyABJCEggChxawAQMKmAT0BErBMHDCg9GmAENdA2ygwQG
cniDBCncsIQEG2BARBAY5LDBDyemmMF6hBgww4Yz0rjEeARMYgCEDUEwscGPJ66wgXaOOHCBgDOmkMKS
LWCAQQxQ5iDlD2jq4IFwgxQwwxIhKMlkC0CMaUOZUm6wQg9sFomfgV/SKWYTZAaRgw06ktCnIxy4sIEE
E1gAxARiPolBCya4BdogBCgAgQlJpPADBkFkoIMRREISCAA7
</value>
</data>
<metadata name="MenuForm.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>206, 17</value>
</metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIABKAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAAARn
QU1BAACxjwv8YQUAAAIBSURBVFhHxZexTsMwEIY7lJdgZS9CYmAAVAk23oChAwOvwNIJiU5MwMSMBCNs
ZSqVWJGanYGxlKEValloMf5cJ7qmbnCVhJz0S9H5fP+f2Hd2Sr72MVKrGsfdobp5H6pAo6+hLHgOGCOG
WDstvXW/1JZOfCfIvMAc5to0y1urpcq9kbp0JV8G5CCXTetnemJFoyMTpQS5KjZ9svU+1bYOHojJWWFA
bkvjNh3Em+dBHoLc7i/BOunBLD/7InSceyKLDecLuCzt1CgXV2CemClRWefXLxNVexgbNJ4nM2i+/qiT
+mmE3eqegfQ1zi+cfkkO4DTkdC05gIC1q28nEFAuryQCAXGfSwAwHZPWKZ2hgHpr+sZx3DefIqxvbBpI
XyjgsHYU+RCwU903z5ILbj4/vT1ytt9+jACESL8LJAXSB0n8rXnGFxcAN7XPwRI5Uwt4bHsL0AgQIE+1
aAkWbUIZ6xJwZpcgvgmBQ0AfATPOvzahjE0SIAG5jJGYE5DHEiRhbgn+WYBZgtw3YQKC7MtwCQGmDOON
CAEHt+NUAvD5CDCNiHYonZQKk/NAvAzhNucBB4MUwCfMA1IAnIYck8cxQXkiEhC/MRd6IcEKv5JherC4
S2lohV7LQ9PBxf2YhMY6ZbExybFwzX2McpF9whfMmSu1NEbXonXSvzVBRr/npdIvW6FdJBbwQIAAAAAA
SUVORK5CYII=
</value>
</data>
</root>
@@ -0,0 +1,82 @@
namespace SuperDesign.Manager.Site
{
partial class FrmFTPSelect
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.objectListView1 = new BrightIdeasSoftware.ObjectListView();
this.OlvName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
((System.ComponentModel.ISupportInitialize)(this.objectListView1)).BeginInit();
this.SuspendLayout();
//
// objectListView1
//
this.objectListView1.AllColumns.Add(this.OlvName);
this.objectListView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.objectListView1.CellEditUseWholeCell = false;
this.objectListView1.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.OlvName});
this.objectListView1.Cursor = System.Windows.Forms.Cursors.Default;
this.objectListView1.FullRowSelect = true;
this.objectListView1.HideSelection = false;
this.objectListView1.Location = new System.Drawing.Point(12, 12);
this.objectListView1.Name = "objectListView1";
this.objectListView1.Size = new System.Drawing.Size(276, 228);
this.objectListView1.TabIndex = 0;
this.objectListView1.UseCompatibleStateImageBehavior = false;
this.objectListView1.View = System.Windows.Forms.View.Details;
this.objectListView1.DoubleClick += new System.EventHandler(this.ObjectListView1_DoubleClick);
//
// OlvName
//
this.OlvName.Text = "名称";
this.OlvName.Width = 250;
//
// FrmFTPSelect
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(300, 252);
this.Controls.Add(this.objectListView1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmFTPSelect";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "选择FTP";
((System.ComponentModel.ISupportInitialize)(this.objectListView1)).EndInit();
this.ResumeLayout(false);
}
#endregion
private BrightIdeasSoftware.OLVColumn OlvName;
public BrightIdeasSoftware.ObjectListView objectListView1;
}
}
@@ -0,0 +1,32 @@
using GameBackup3H3.DbOp;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 开发辅助工具.Manager;
namespace SuperDesign.Manager.Site
{
public partial class FrmFTPSelect : Form
{
public FrmFTPSelect()
{
InitializeComponent();
OlvName.AspectGetter = delegate (object x) { return ((FTPInfo)x).Name; };
}
public FTPInfo SelectedItem { get; set; } = null;
private void ObjectListView1_DoubleClick(object sender, EventArgs e)
{
var item = (FTPInfo)objectListView1.SelectedObject;
if (item == null) { return; }
SelectedItem = item;
DialogResult = DialogResult.OK;
}
}
}
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,258 @@
namespace GameBackup3H3.DbOp
{
partial class FrmFTPView
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmFTPView));
this.rySearch1 = new ryControls.rySearch();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.复制并添加数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.添加数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.修改数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.删除数据ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.ctlMyPage1 = new MyPage.ctlMyPage();
this.btnDel = new ryControls.ButtonEx();
this.btnEdit = new ryControls.ButtonEx();
this.btnAdd = new ryControls.ButtonEx();
this.LvCbResult = new BrightIdeasSoftware.FastObjectListView();
this.OlvName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvIP = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvPort = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvUserName = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.OlvAddTime = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
this.contextMenuStrip1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.LvCbResult)).BeginInit();
this.SuspendLayout();
//
// rySearch1
//
this.rySearch1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.rySearch1.ButtonRoundBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(236)))), ((int)(((byte)(239)))), ((int)(((byte)(244)))));
this.rySearch1.EmptyText = "请输入搜索内容";
this.rySearch1.Location = new System.Drawing.Point(12, 5);
this.rySearch1.Name = "rySearch1";
this.rySearch1.Size = new System.Drawing.Size(329, 24);
this.rySearch1.TabIndex = 28;
this.rySearch1.OnSearch += new System.EventHandler(this.RySearch1_OnSearch);
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.复制并添加数据ToolStripMenuItem,
this.添加数据ToolStripMenuItem,
this.修改数据ToolStripMenuItem,
this.删除数据ToolStripMenuItem});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.Size = new System.Drawing.Size(161, 92);
//
// 复制并添加数据ToolStripMenuItem
//
this.复制并添加数据ToolStripMenuItem.Name = "复制并添加数据ToolStripMenuItem";
this.复制并添加数据ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.复制并添加数据ToolStripMenuItem.Text = "复制并添加数据";
this.复制并添加数据ToolStripMenuItem.Click += new System.EventHandler(this.复制并添加数据ToolStripMenuItem_Click);
//
// 添加数据ToolStripMenuItem
//
this.添加数据ToolStripMenuItem.Name = "添加数据ToolStripMenuItem";
this.添加数据ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.添加数据ToolStripMenuItem.Text = "添加数据";
this.添加数据ToolStripMenuItem.Click += new System.EventHandler(this.添加数据ToolStripMenuItem_Click);
//
// 修改数据ToolStripMenuItem
//
this.修改数据ToolStripMenuItem.Name = "修改数据ToolStripMenuItem";
this.修改数据ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.修改数据ToolStripMenuItem.Text = "修改数据";
this.修改数据ToolStripMenuItem.Click += new System.EventHandler(this.修改数据ToolStripMenuItem_Click);
//
// 删除数据ToolStripMenuItem
//
this.删除数据ToolStripMenuItem.Name = "删除数据ToolStripMenuItem";
this.删除数据ToolStripMenuItem.Size = new System.Drawing.Size(160, 22);
this.删除数据ToolStripMenuItem.Text = "删除数据";
this.删除数据ToolStripMenuItem.Click += new System.EventHandler(this.删除数据ToolStripMenuItem_Click);
//
// ctlMyPage1
//
this.ctlMyPage1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.ctlMyPage1.Location = new System.Drawing.Point(12, 516);
this.ctlMyPage1.Name = "ctlMyPage1";
this.ctlMyPage1.PageSize = 50;
this.ctlMyPage1.RecordCount = 0;
this.ctlMyPage1.Size = new System.Drawing.Size(506, 26);
this.ctlMyPage1.SQLText = "";
this.ctlMyPage1.SQLText2 = "";
this.ctlMyPage1.T_FirstCaption = "首页";
this.ctlMyPage1.T_LastCaption = "末页";
this.ctlMyPage1.T_NextCaption = "下一页";
this.ctlMyPage1.T_Parameters = null;
this.ctlMyPage1.T_PreCaption = "上一页";
this.ctlMyPage1.T_SkipCaption = "跳到";
this.ctlMyPage1.T_TipCaption = "{pageindex}/{pagecount} 页,共 {recordcount} 条记录,每页 {pagesize} 条";
this.ctlMyPage1.TabIndex = 30;
this.ctlMyPage1.OnPageChange += new System.EventHandler(this.CtlMyPage1_OnPageChange);
//
// btnDel
//
this.btnDel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnDel.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.btnDel.Location = new System.Drawing.Point(673, 5);
this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(62, 24);
this.btnDel.TabIndex = 40;
this.btnDel.Text = "删除";
this.btnDel.UseVisualStyleBackColor = true;
this.btnDel.Click += new System.EventHandler(this.BtnDel_Click);
//
// btnEdit
//
this.btnEdit.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnEdit.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.btnEdit.Location = new System.Drawing.Point(605, 5);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(62, 24);
this.btnEdit.TabIndex = 39;
this.btnEdit.Text = "修改";
this.btnEdit.UseVisualStyleBackColor = true;
this.btnEdit.Click += new System.EventHandler(this.BtnEdit_Click);
//
// btnAdd
//
this.btnAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAdd.BaseColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(76)))), ((int)(((byte)(95)))));
this.btnAdd.Location = new System.Drawing.Point(537, 5);
this.btnAdd.Name = "btnAdd";
this.btnAdd.Size = new System.Drawing.Size(62, 24);
this.btnAdd.TabIndex = 38;
this.btnAdd.Text = "添加";
this.btnAdd.UseVisualStyleBackColor = true;
this.btnAdd.Click += new System.EventHandler(this.BtnAdd_Click);
//
// LvCbResult
//
this.LvCbResult.AllColumns.Add(this.OlvName);
this.LvCbResult.AllColumns.Add(this.OlvIP);
this.LvCbResult.AllColumns.Add(this.OlvPort);
this.LvCbResult.AllColumns.Add(this.OlvUserName);
this.LvCbResult.AllColumns.Add(this.OlvAddTime);
this.LvCbResult.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.LvCbResult.CellEditUseWholeCell = false;
this.LvCbResult.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.OlvName,
this.OlvIP,
this.OlvPort,
this.OlvUserName,
this.OlvAddTime});
this.LvCbResult.ContextMenuStrip = this.contextMenuStrip1;
this.LvCbResult.Cursor = System.Windows.Forms.Cursors.Default;
this.LvCbResult.EmptyListMsg = "当前列表没有任何项";
this.LvCbResult.FullRowSelect = true;
this.LvCbResult.HideSelection = false;
this.LvCbResult.Location = new System.Drawing.Point(12, 35);
this.LvCbResult.Name = "LvCbResult";
this.LvCbResult.RowHeight = 25;
this.LvCbResult.ShowGroups = false;
this.LvCbResult.ShowItemToolTips = true;
this.LvCbResult.Size = new System.Drawing.Size(723, 479);
this.LvCbResult.TabIndex = 85;
this.LvCbResult.UseCompatibleStateImageBehavior = false;
this.LvCbResult.UseFiltering = true;
this.LvCbResult.View = System.Windows.Forms.View.Details;
this.LvCbResult.VirtualMode = true;
this.LvCbResult.DoubleClick += new System.EventHandler(this.LvCbResult_DoubleClick);
//
// OlvName
//
this.OlvName.Text = "名称";
this.OlvName.Width = 200;
//
// OlvIP
//
this.OlvIP.Text = "IP";
this.OlvIP.Width = 130;
//
// OlvPort
//
this.OlvPort.Text = "端口";
//
// OlvUserName
//
this.OlvUserName.Text = "用户名";
this.OlvUserName.Width = 100;
//
// OlvAddTime
//
this.OlvAddTime.Text = "时间";
this.OlvAddTime.Width = 200;
//
// FrmFTPView
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(747, 546);
this.Controls.Add(this.LvCbResult);
this.Controls.Add(this.btnDel);
this.Controls.Add(this.btnEdit);
this.Controls.Add(this.btnAdd);
this.Controls.Add(this.ctlMyPage1);
this.Controls.Add(this.rySearch1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "FrmFTPView";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "浏览";
this.Load += new System.EventHandler(this.FrmView_Load);
this.contextMenuStrip1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.LvCbResult)).EndInit();
this.ResumeLayout(false);
}
#endregion
private ryControls.rySearch rySearch1;
private MyPage.ctlMyPage ctlMyPage1;
private ryControls.ButtonEx btnDel;
private ryControls.ButtonEx btnEdit;
private ryControls.ButtonEx btnAdd;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem 添加数据ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 修改数据ToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem 删除数据ToolStripMenuItem;
private BrightIdeasSoftware.FastObjectListView LvCbResult;
private BrightIdeasSoftware.OLVColumn OlvName;
private BrightIdeasSoftware.OLVColumn OlvAddTime;
private BrightIdeasSoftware.OLVColumn OlvIP;
private BrightIdeasSoftware.OLVColumn OlvPort;
private BrightIdeasSoftware.OLVColumn OlvUserName;
private System.Windows.Forms.ToolStripMenuItem 复制并添加数据ToolStripMenuItem;
}
}
@@ -0,0 +1,283 @@
using ryCommon;
using ryCommonDb;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using 开发辅助工具.Manager;
namespace GameBackup3H3.DbOp
{
public partial class FrmFTPView : Form
{
readonly string orderSQL = "order by addTime desc";
readonly string tableName = "FTP";
readonly string titleName = "FTP管理";
public FrmFTPView()
{
InitializeComponent();
OlvName.AspectGetter = delegate (object x) { return ((FTPInfo)x).Name; };
OlvIP.AspectGetter = delegate (object x) { return ((FTPInfo)x).IP; };
OlvPort.AspectGetter = delegate (object x) { return ((FTPInfo)x).Port; };
OlvUserName.AspectGetter = delegate (object x) { return ((FTPInfo)x).UserName; };
OlvAddTime.AspectGetter = delegate (object x) { return ((FTPInfo)x).AddTimeStr; };
}
#region 需要修改的内容
private void RySearch1_OnSearch(object sender, EventArgs e)
{
//需要修改此处
LoadDb("(name like @SearchText or des like @SearchText)");
}
private void CtlMyPage1_OnPageChange(object sender, EventArgs e)
{
#region 重新载入数据
LvCbResult.ClearObjects();
List<FTPInfo> list = new List<FTPInfo>();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData(ctlMyPage1.GetSQLText, ctlMyPage1.T_Parameters);
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow row = ds.Tables[0].Rows[i];
list.Add(new FTPInfo()
{
Id=row["id"].ToInt(),
Name = row["name"].ToString(),
IP = row["ip"].ToString(),
Port = row["port"].ToInt(),
RemoteDir = row["remoteDir"].ToString(),
UserName = row["username"].ToString(),
Pwd = row["pwd"].ToString(),
Encrypt = row["encrypt"].ToInt(0,2,0),
AddTime = row["AddTime"].ToDateTime()
}) ;
}
}
db.Free();
LvCbResult.AddObjects(list);
#endregion
}
private void GetRow(int id, int index)
{
#region 重新载入数据
DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
DataSet ds = db.ReadData("select * from " + tableName + " where id=" + id);
if (mydb.HaveData(ds))
{
DataRow row = ds.Tables[0].Rows[0];
var item=(FTPInfo) LvCbResult.GetModelObject(index);
item.Name = row["name"].ToString();
item.IP = row["ip"].ToString();
item.Port = row["port"].ToInt();
item.RemoteDir = row["remoteDir"].ToString();
item.UserName = row["username"].ToString();
item.Pwd = row["pwd"].ToString();
item.Encrypt = row["encrypt"].ToInt(0, 2, 0);
//添加剩余的项目
//添加完毕
LvCbResult.UpdateObject(item);
}
}
db.Free();
#endregion
}
#endregion
public void LoadDb(string whereSQL)
{
string _whereSQL = whereSQL;
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
#region 重新载入数据
db.AddParameter("SearchText", "%" + rySearch1.Text + "%");
ctlMyPage1.RecordCount = db.GetCount(tableName, _whereSQL);
ctlMyPage1.T_Parameters = db.GetParameter();
ctlMyPage1.SQLText= db.GetPageSQL(tableName, _whereSQL, orderSQL);
ctlMyPage1.SQLText2 = db.GetPageSQL2(tableName, _whereSQL, orderSQL);
ctlMyPage1.GotoPageIndex(1);
#endregion
}
db.Free();
}
private void BtnAdd_Click(object sender, EventArgs e)
{
FrmAddFTP frm = new FrmAddFTP()
{
Text = "添加"+ titleName,
Icon = Icon,
isAdd = 1
};
frm.mr = new ModalForm(this, frm);
frm.mr.OnDialogResult += new ModalForm.DialogResultHandler((object t, DialogResult dg) => {
if (dg == DialogResult.OK)
{
rySearch1.PerformClick();
}
});
frm.mr.ShowModal();
}
private void BtnEdit_Click(object sender, EventArgs e)
{
if (LvCbResult.SelectedObject == null) { return; }
var item = (FTPInfo)LvCbResult.SelectedObject;
var selectId = item.Id;
FrmAddFTP frm = new FrmAddFTP()
{
Text = "修改"+ titleName,
Icon = Icon,
isAdd = 0
};
frm.GetInfo(selectId.ToString());
frm.mr = new ModalForm(this, frm);
frm.mr.OnDialogResult += new ModalForm.DialogResultHandler((object t, DialogResult dg) => {
if (dg == DialogResult.OK)
{
GetRow(selectId, LvCbResult.SelectedIndex);
}
});
frm.mr.ShowModal();
}
private void BtnDel_Click(object sender, EventArgs e)
{
if (LvCbResult.SelectedObject == null) { MessageBox.Show("请先选择要删除的项。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; }
var item = (FTPInfo)LvCbResult.SelectedObject;
var selectId = item.Id;
switch (MessageBox.Show("确定要删除该项吗?一旦删除将不可恢复。", "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
return;
}
//DataProvider mydb = new DataProvider();
IDbInterface db = Itrycn_Db.CreateDataProvider(Itrycn_Db.dataType);
if (db.ConnDb(Itrycn_Db.User_SQLConn) == 1)
{
var ds = db.ReadData("select * from Site where ftpId=" + selectId + " limit 1");
if (ds.HaveData())
{
ds.Dispose();
db.Free();
MessageBox.Show("当前FTP正在被使用,无法删除。", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning); return;
}
ds?.Dispose();
db.DelById(tableName, selectId.ToString());
LvCbResult.RemoveObject(item);
}
}
private void FrmView_Load(object sender, EventArgs e)
{
Text = "浏览"+ titleName;
添加数据ToolStripMenuItem.Text = "添加"+ titleName;
修改数据ToolStripMenuItem.Text = "修改" + titleName;
删除数据ToolStripMenuItem.Text = "删除" + titleName;
rySearch1.PerformClick();
}
private void 添加数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
btnAdd.PerformClick();
}
private void 修改数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
btnEdit.PerformClick();
}
private void 删除数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
btnDel.PerformClick();
}
private void 复制并添加数据ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (LvCbResult.SelectedObject == null) { return; }
var item = (FTPInfo)LvCbResult.SelectedObject;
var selectId = item.Id;
FrmAddFTP frm = new FrmAddFTP()
{
Text = "添加" + titleName,
Icon = Icon,
isAdd = 1
};
frm.GetInfo(selectId.ToString());
frm.mr = new ModalForm(this, frm);
frm.mr.OnDialogResult += new ModalForm.DialogResultHandler((object t, DialogResult dg) => {
if (dg == DialogResult.OK)
{
rySearch1.PerformClick();
}
});
frm.mr.ShowModal();
}
public bool SelectModeOn { get; set; } = false;
public FTPInfo SelectedItem { get; set; }
private void LvCbResult_DoubleClick(object sender, EventArgs e)
{
if(SelectModeOn)
{
if (LvCbResult.SelectedObject == null) { return; }
SelectedItem = (FTPInfo)LvCbResult.SelectedObject;
DialogResult=DialogResult.OK;
}
}
}
public class FTPInfo
{
/// <summary>
/// id
/// </summary>
public int Id{ get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// IP
/// </summary>
public string IP { get; set; }
/// <summary>
/// 端口
/// </summary>
public int Port { get; set; }
/// <summary>
/// 用户名
/// </summary>
public string UserName { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Pwd { get; set; }
/// <summary>
/// 远程目录
/// </summary>
public string RemoteDir { get; set; }
/// <summary>
/// 加密方式
/// </summary>
public int Encrypt { get; set; }
/// <summary>
/// 添加时间
/// </summary>
public DateTime AddTime { get; set; }
public string Encoding { get; set; }= "UTF8";
/// <summary>
/// 添加时间字符串
/// </summary>
public string AddTimeStr
{
get { return AddTime.ToString("yyyy-MM-dd dddd HH:mm:ss"); }
}
}
}
@@ -0,0 +1,139 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>35, 21</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIABKAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAAARn
QU1BAACxjwv8YQUAAAIBSURBVFhHxZexTsMwEIY7lJdgZS9CYmAAVAk23oChAwOvwNIJiU5MwMSMBCNs
ZSqVWJGanYGxlKEValloMf5cJ7qmbnCVhJz0S9H5fP+f2Hd2Sr72MVKrGsfdobp5H6pAo6+hLHgOGCOG
WDstvXW/1JZOfCfIvMAc5to0y1urpcq9kbp0JV8G5CCXTetnemJFoyMTpQS5KjZ9svU+1bYOHojJWWFA
bkvjNh3Em+dBHoLc7i/BOunBLD/7InSceyKLDecLuCzt1CgXV2CemClRWefXLxNVexgbNJ4nM2i+/qiT
+mmE3eqegfQ1zi+cfkkO4DTkdC05gIC1q28nEFAuryQCAXGfSwAwHZPWKZ2hgHpr+sZx3DefIqxvbBpI
XyjgsHYU+RCwU903z5ILbj4/vT1ytt9+jACESL8LJAXSB0n8rXnGFxcAN7XPwRI5Uwt4bHsL0AgQIE+1
aAkWbUIZ6xJwZpcgvgmBQ0AfATPOvzahjE0SIAG5jJGYE5DHEiRhbgn+WYBZgtw3YQKC7MtwCQGmDOON
CAEHt+NUAvD5CDCNiHYonZQKk/NAvAzhNucBB4MUwCfMA1IAnIYck8cxQXkiEhC/MRd6IcEKv5JherC4
S2lohV7LQ9PBxf2YhMY6ZbExybFwzX2McpF9whfMmSu1NEbXonXSvzVBRr/npdIvW6FdJBbwQIAAAAAA
SUVORK5CYII=
</value>
</data>
</root>
@@ -0,0 +1,101 @@
namespace 开发辅助工具.Manager.FTP
{
partial class FrmUploadProg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmUploadProg));
this.progressBar1 = new System.Windows.Forms.ProgressBar();
this.label1 = new System.Windows.Forms.Label();
this.ProgAll = new System.Windows.Forms.ProgressBar();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(12, 39);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(368, 32);
this.progressBar1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 24);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(83, 12);
this.label1.TabIndex = 1;
this.label1.Text = "正在上传中...";
//
// ProgAll
//
this.ProgAll.Location = new System.Drawing.Point(12, 101);
this.ProgAll.Name = "ProgAll";
this.ProgAll.Size = new System.Drawing.Size(368, 32);
this.ProgAll.TabIndex = 2;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 86);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(53, 12);
this.label2.TabIndex = 3;
this.label2.Text = "全部进度";
//
// FrmTranProg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(392, 166);
this.Controls.Add(this.label2);
this.Controls.Add(this.ProgAll);
this.Controls.Add(this.label1);
this.Controls.Add(this.progressBar1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "FrmTranProg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "上传中...";
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.FrmTranProg_FormClosing);
this.Shown += new System.EventHandler(this.FrmTranProg_Shown);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ProgressBar progressBar1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ProgressBar ProgAll;
private System.Windows.Forms.Label label2;
}
}
@@ -0,0 +1,174 @@
using GameBackup3H3.DbOp;
using ryCommon;
using SuperDesign.Manager.FTP;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace 开发辅助工具.Manager.FTP
{
public partial class FrmUploadProg : Form
{
public FrmUploadProg()
{
InitializeComponent();
}
public List<UploadInfo> UploadList { get; set; } = new List<UploadInfo>();
private void FrmTranProg_FormClosing(object sender, FormClosingEventArgs e)
{
if(e.CloseReason== CloseReason.UserClosing) { e.Cancel = true; }
}
private void FrmTranProg_Shown(object sender, EventArgs e)
{
ProgAll.Maximum = UploadList.Count;
Thread th = new Thread(Start);
th.Start();
void Start()
{
var error = 0;
for (int i = 0; i < UploadList.Count; i++)
{
var item = UploadList[i];
FTPop.FTPWinSCP ftp = (FTPop.FTPWinSCP)FTPManger.GetFTP(item.FtpInfo,out var result);
FTPManger.FileTransferProgress += Ftp_FileTransferProgress;
this.Invoke(new Action(() =>
{
ProgAll.Value = i;
label1.Text = "正在登录FTP...";
}));
if (result == 1)
{
this.Invoke(new Action(() =>
{
label1.Text = "正在上传文件...";
}));
var remotedir = System.IO.Path.GetDirectoryName(item.RemotePath).Replace("\\", "/");
if (!ftp.FileExists(remotedir))
{
ftp.CreateDir(remotedir);
}
else
{
if (item.LocalPath.Length > 0)
{
var remote_fileinfo = ftp.GetFileInfo(item.RemotePath);
if (remote_fileinfo.LastWriteTime != DateTime.MinValue)
{
bool goto_next = false;
if (remote_fileinfo.LastWriteTime.ToInt64() >= RyFiles.GetFileDate(item.LocalPath).LastWriteTime.ToInt64())
{
this.Invoke(new Action(() =>
{
switch (MessageBox.Show("当前服务器上的文件日期比本地新,是否要替换?\r\n\r\n" + item.LocalPath, "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
error++;
goto_next = true;
break;
}
}));
}
else if (RyFiles.GetFileDate(item.LocalPath).LastWriteTime.ToInt64() == remote_fileinfo.LastWriteTime.ToInt64())
{
if (RyFiles.GetFileSize(item.LocalPath) != remote_fileinfo.Length)
{
this.Invoke(new Action(() =>
{
switch (MessageBox.Show("当前本地文件与服务器文件日期一致,但大小不一致,是否要替换?\r\n\r\n本地:" + RyFiles.GetFileSizeStr(item.LocalPath) + "=>服务器:" + RyFiles.GetFileSizeStr(remote_fileinfo.Length), "询问", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2))
{
case DialogResult.No:
error++;
goto_next = true;
break;
}
}));
}
}
if (goto_next) { continue; }
}
}
}
var LocalPath = item.LocalPath;
var tmp_path = "";
if (LocalPath.Length == 0)
{
tmp_path = Application.StartupPath + "\\UserDb\\tmp\\FTP\\" + System.IO.Path.GetFileName(item.RemotePath);
RyFiles.WriteAllText(tmp_path, item.Content, item.Encoding);
LocalPath = tmp_path;
}
if (ftp.Upload(LocalPath, item.RemotePath) == 1)
{
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("上传失败=>" + (item.LocalPath.Length>0? item.LocalPath: item.RemotePath) + "\r\n" + ftp.ErrorMsg, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
error++;
}));
if(ftp.ErrorMsg.IndexOfEx("already read to the end")>=0)
{
ftp.Close();
//ftp= (FTPop.FTPWinSCP)FTPManger.GetFTP(item.FtpInfo, out var _);
}
}
if(tmp_path.Length>0)
RyFiles.DeleteFile(tmp_path);
}
else
{
this.Invoke(new Action(() =>
{
MessageBox.Show("FTP登录失败=>"+item.LocalPath, "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
error++;
}));
}
FTPManger.FileTransferProgress -= Ftp_FileTransferProgress;
}
this.Invoke(new Action(() =>
{
ProgAll.Value = ProgAll.Maximum;
if (error == 0)
{
DialogResult = DialogResult.OK;
}
else
{
DialogResult = DialogResult.No;
}
}));
}
}
private void Ftp_FileTransferProgress(object sender, FTPop.FileTransferProgressEventArgs e)
{
this.Invoke(new Action(() =>
{
progressBar1.Value = (e.FileProgress*100).ToInt();
}));
}
}
public class UploadInfo
{
public FTPInfo FtpInfo { get; set; } = new FTPInfo();
public string RemotePath { get; set; } = "";
public string LocalPath { get; set; } = "";
/// <summary>
/// 当LocalPath为空时生效
/// </summary>
public string Content { get; set; } = "";
/// <summary>
/// 当LocalPath为空时生效
/// </summary>
public Encoding Encoding { get; set; } = Encoding.UTF8;
}
}
@@ -0,0 +1,137 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAICAAAAAAIACLAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAgAAAAIAgGAAAAc3p69AAAAARn
QU1BAACxjwv8YQUAAAJCSURBVFhH7VY9SxxRFN3aMkRmd7CwSwwIkRS2YmFlJQhRSRAS/QN+tFaJje7M
bBAR0TQBQUyhYJ1KQQmksRRSBQKm0h9wc+7kzPPOJ65sujlwYfacc++772PebKNGjRrdwg/lWSuQj81Q
9hGnzUhOvEB2vFA+qEbb/0EzkFUMeoOQkrhRD+29BYofZgbT+Im4znAah0zrDbSgKx7JL8Sa15Zhyg1/
Q54rF2u9bgKFVpKi2Oezp4G0KOWgGnzfEj9ihdLjgSKXLHaHBkZJl6I/kJfw3jLnkvTj4EXynoWkFco6
6RjNjryA/gXatj6TjoGD2EnyEG9JPxwF+yl2z3VAcFdGv7JN6EoZTc/NBZqdpVyNeHCbzKBcNHgSqSYK
dMHKLFMuBgzzqQQ004rkFeWqwZNIN6H+/ISmKecB0Z1gLPlr0jEKBv9tnku3Q4Gbcsbo56TTwOzHnCmS
PdIO4Lecrm+G9f97tk0sMc1BayZ64atsC+Kuf0PawWzPEX+nG8Cscfh+6G+dcZxkgK1cTPx2Wx0yDUyR
TsF2nm2AtPKDfEzBbgPqD5G+h78jfa5gKJ9Jl6KsgTLAd0D/H1J5QPxKk167lbdeNw3oqjhvKMek89DL
whi18HzZN/4hDWguDp9+wl1N75OMUy4Gii3bBMZ3rMgkLTGqGvDbMqE5Tmfg8O3SUg0ckjkkpC4c/ddD
OUZVA+Cy/x3uEN19GQfa8gSzfqcDIzn3bVddeQzewSvYT9qBeVuoseBvygjpGjVqZNBo/AWpD6xpQDoH
PQAAAABJRU5ErkJggg==
</value>
</data>
</root>
@@ -0,0 +1,127 @@
using GameBackup3H3.DbOp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace FTPop
{
public interface IFTP
{
/// <summary>
/// 打开FTP
/// </summary>
/// <param name="ftpinfo"></param>
int Open(FTPInfo ftpinfo);
/// <summary>
/// FTP是否打开着
/// </summary>
/// <param name="ftpinfo"></param>
bool IsOpen { get; }
/// <summary>
/// 关闭FTP。
/// </summary>
/// <returns></returns>
int Close();
/// <summary>
/// 显示文件夹列表
/// </summary>
/// <param name="CurFolder"></param>
/// <returns></returns>
List<RemoteFileInfo> ListDirectory(string CurFolder,out string error);
/// <summary>
/// 上传
/// </summary>
/// <param name="localPath"></param>
/// <param name="remotePath"></param>
/// <returns></returns>
int Upload(string localPath, string remotePath);
/// <summary>
/// 下载
/// </summary>
/// <param name="remotePath"></param>
/// <param name="localPath"></param>
/// <returns></returns>
int Download(string remotePath, string localPath);
/// <summary>
/// 删除文件
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
int RemoveFiles(string remotePath);
/// <summary>
/// 移动文件
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
int MoveFile(string fromPath,string toPath);
/// <summary>
/// 文件是否存在
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
bool FileExists(string remotePath);
/// <summary>
/// 文件大小
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
Int64 FileSize(string remotePath);
/// <summary>
/// 文件最后修改时间
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
DateTime FileLastWriteTime(string remotePath);
/// <summary>
/// 文件信息
/// </summary>
/// <param name="remotePath"></param>
/// <returns></returns>
RemoteFileInfo GetFileInfo(string remotePath);
/// <summary>
/// 文件传输事件
/// </summary>
event FileTransferProgressEventHandler FileTransferProgress;
}
public delegate void FileTransferProgressEventHandler(object sender, FileTransferProgressEventArgs e);
public sealed class FileTransferProgressEventArgs : EventArgs
{
/// <summary>
/// 文件全路径
/// </summary>
public string LocalPath { get; internal set; }
/// <summary>
/// 当前文件进度
/// </summary>
public double FileProgress { get; internal set; }
/// <summary>
/// 当前传输速度
/// </summary>
public double Speed { get; internal set; }
/// <summary>
/// 是否完成
/// </summary>
public bool IsComplete { get; internal set; } = false;
/// <summary>
/// 是否要取消
/// </summary>
public bool Cancel { get; set; }
}
/// <summary>
/// 远程文件信息
/// </summary>
public class RemoteFileInfo
{
public string Name { get; set; }
public string FullName { get; set; }
public long Length { get; set; }
public DateTime LastWriteTime { get; set; } = DateTime.MinValue;
public bool IsDirectory { get; set; }
public override string ToString()
{
return FullName;
}
}
}