Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorge Matos jorgepsmatos

View GitHub Profile
View Delete.cs
public void Delete(string fileToDelete, string host, string username, string password)
{
try
{
using (var sftpClient = new SftpClient(host, username, password))
{
sftpClient.Connect();
sftpClient.DeleteFile(fileToDelete);
View Download.cs
public void Download(string fileToDownload, string host, string username, string password)
{
try
{
using (var sftpClient = new SftpClient(host, username, password))
using (var fs = new FileStream(Path.GetFileName(fileToDownload), FileMode.OpenOrCreate))
{
sftpClient.Connect();
sftpClient.DownloadFile(
View Upload.cs
public void Upload(string fileToUpload, string host, string username, string password)
{
try
{
using (var sftpClient = new SftpClient(host, username, password))
using (var fs = new FileStream(fileToUpload, FileMode.Open))
{
sftpClient.Connect();
sftpClient.UploadFile(
View ListDirectory.cs
public void ListDirectory(string remoteDirectory, string host, string username, string password)
{
try
{
using (var sftpClient = new SftpClient(host, username, password))
{
sftpClient.Connect();
var files = sftpClient.ListDirectory(remoteDirectory);
@jorgepsmatos
jorgepsmatos / SMWinservice.py
Created Nov 27, 2018
Python Http Server as Windows Service
View SMWinservice.py
'''
SMWinservice
by Davide Mastromatteo
from https://medium.com/the-python-corner/how-to-create-a-windows-service-in-python-88ca534ce76b
Base class to create winservice in Python
-----------------------------------------
Instructions:
@jorgepsmatos
jorgepsmatos / cloudSettings
Last active Apr 11, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-04-11T19:00:18.139Z","extensionVersion":"v3.4.3"}
You can’t perform that action at this time.