viewgit/index.php:465 Only variables should be passed by reference [2048]
viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]
using System; using Tamir.SharpSsh; using System.Collections; using System.IO; namespace Dizzy { public class SFTPConnection { public Sftp sftp; string user; public delegate void SFTPEvent (string src, string dest, int transferredBytes, int totalBytes, string message); public event SFTPEvent TransferStarted; public event SFTPEvent TransferProgress; public event SFTPEvent TransferStopped; public delegate void Del (string src, string dest, int transferredBytes, int totalBytes, string message); public SFTPConnection (string user, string password) { // Inizializziamo il protocollo this.user = user; this.sftp.Password = password; } public void Abort () { this.sftp.Cancel (); } private void TransferStartedHandler(string src, string dest, int transferredBytes, int totalBytes, string message) { if(TransferStarted != null) TransferStarted(src, dest, transferredBytes, totalBytes, message); } private void TransferProgressHandler(string src, string dest, int transferredBytes, int totalBytes, string message) { if (TransferProgress != null) TransferProgress(src, dest, transferredBytes, totalBytes, message); } private void TransferStoppedHandler(string src, string dest, int transferredBytes, int totalBytes, string message) { if (TransferStopped != null) TransferStopped(src, dest, transferredBytes, totalBytes, message); } public void Connect() { sftp.Connect (22); } public void Download(File f, string downloadFolder) { this.sftp.Get (f.path, downloadFolder + Path.DirectorySeparatorChar + f.name); } public void Upload(string filename) { /* Normalizziamo il nome della cartella sul server */ string folder = GlobalConfig.GetValue("folder"); if (!folder.EndsWith("/")) folder = folder + "/"; this.sftp.Put(filename, folder + this.user + "/"); } public void Disconnect () { sftp.Close (); } } }