Skip to content

Commit

Permalink
Changed = to ., Fixed readme with proper exe names
Browse files Browse the repository at this point in the history
  • Loading branch information
RuurdBijlsma committed Jan 2, 2018
1 parent d3153fb commit 7398087
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 9 deletions.
7 changes: 7 additions & 0 deletions .idea/.idea.SendToSftp/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/.idea.SendToSftp/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/.idea.SendToSftp/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions .idea/.idea.SendToSftp/riderModule.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SendToSFTP
# SendToSftp
Send a file to an server via SFTP and the Send to menu in Windows
## Usage
Setup connection.json at the same location as SendToSFTP.exe, should look like this:
Setup connection.json at the same location as SendToSftp.exe, should look like this:
```
{
"Ip": "192.168.0.141",
Expand All @@ -13,7 +13,7 @@ Setup connection.json at the same location as SendToSFTP.exe, should look like t
```
The multithreaded option can be a bit unstable.

To add it to the Send To menu in Windows, press Win + R and type `shell:sendto`, this will open an explorer window. Paste a shortcut to the SendToSFTP.exe here. Renaming it will rename it in the Send to menu.
To add it to the Send To menu in Windows, press Win + R and type `shell:sendto`, this will open an explorer window. Paste a shortcut to the SendToSftp.exe here. Renaming it will rename it in the Send to menu.

## Compile
First make sure you have the [dotnet core sdk](https://www.microsoft.com/net/download/windows) installed
Expand Down
14 changes: 8 additions & 6 deletions SendToSftp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static void Main(string[] args)
return;
}

Console.WriteLine("Connecting to " + connection.Ip + "...");
Console.WriteLine("Connecting to " + connection.Ip + "...\n");
using (var client = new SftpClient(connection.Ip, connection.User, connection.Password))
{
client.Connect();
Expand All @@ -51,8 +51,8 @@ private static void Main(string[] args)

lock (LockObject)
{
Console.SetCursorPosition(line + 1, 0);
Console.WriteLine("\n\n\nDone!");
Console.SetCursorPosition(0, line + 1);
Console.WriteLine("Done!");
}
}
}
Expand All @@ -66,13 +66,15 @@ private static void Main(string[] args)
}
}

private const string LoadingCharacter = ".";

private static void Upload(string file, SftpClient client, string desinationPath, int row)
{
var uploadFile = new FileInfo(file);
using (var fileStream = new FileStream(uploadFile.FullName, FileMode.Open))
{
var col = 0;
var sendMsg = "Sending " + uploadFile.Name + " ";
var sendMsg = "Sending " + uploadFile.Name;

float completion = 0;
var consoleWidth = Console.WindowWidth;
Expand All @@ -96,7 +98,7 @@ private static void Upload(string file, SftpClient client, string desinationPath
{
Console.SetCursorPosition(col, row);
for (var i = 0; i < consoleWidth - col; i++)
Console.Write("=");
Console.Write(LoadingCharacter);
Console.WriteLine();
}
Expand All @@ -108,7 +110,7 @@ private static void Upload(string file, SftpClient client, string desinationPath
lock (LockObject)
{
Console.SetCursorPosition(col, row);
Console.Write("=");
Console.Write(LoadingCharacter);
}
col++;
Expand Down

0 comments on commit 7398087

Please sign in to comment.