無駄な努力や非効率な努力があっても良いじゃないかな。効率的が全てではない。

2021.06.02

Logging

ガンバリマスとか言っているけど、今まで本当に頑張ったことがない自分。頑張ったら出来るというのは正しくないかもなとは思っている。人には得意分野や不得意分野があったりしますからね。ただ頑張っている人に否定する言葉は投げかけるのは辞めている。何故ならその人が一番自分の限界というものを知っているから、どこで切り替えるのかは、その人に任せれば良い。自分のことをわからない人でも気づく時が来るから言わないほうが良いし、人の技量なんてものを測れる人はあまりいない殆どの人は誤った判断する。

奥田民生「マシマロ」(Official Music Video)

この頃、世の中は効率的に成功する事が良いような空気が流れているけど、それで本当に良いのかと・・・。無駄な努力もあって良いし、非効率な努力もあって良いじゃないかなと思います。自分で考えない人がこの頃、多くなったのか?

洗脳されやすい人が増えてきている気もします。マイノリティー(少数派)が正しい事だってあるのだから、長い目で見るという事が大事になってくるのだと、それを忘れかけている世の中にはなって欲しくないなと。

そういう事が出来なくなっているのは人々に余裕がなくなってきている証拠なのかもしれない。要するに心に余裕がない時は社会や人に当たりやすくなるという事そして誤った判断の中で世の中が進む時もある。

【MV】松岡茉優が槇原敬之の名曲『どんなときも。』をカバー

著者名  @taoka_toshiaki

※この記事は著者が40代前半に書いたものです.

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

61, 8, com, fYz-, https, vx, watch, Wi, www, youtube, ガンバリ, こと, どこ, ます, もの, 不得意, , , , , 全て, 分野, 判断, 努力, 効率, 否定, , 得意, 成功, 技量, , 本当, 殆ど, 洗脳, 無駄, 空気, 自分, 言葉, 限界, ,

DropFTPを配布。

2018.12.01

Logging

ドップして一つのファイルを転送するソフトを作りました。
こんなのどうしているのかと疑問を持つ人もいると思いますが
業務上、こんなソフトが要るという会社などもいるのではないかと
思いで作りました。
ダウンロードはこちらから
https://zip358.com/tool/DropFTP.zip
ソースコードは下記になります。
※FTP部分はWinSCPのライブラリを使用しています。

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 WinSCP;
namespace dropFTP
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void upbtn_Click(object sender, EventArgs e)
        {
            String err = "";
            if (hostText.Text == "") {
                err += "ホスト名が設定されていませんn";
            }
            if (idText.Text == "")
            {
                err += "IDが設定されていませんn";
            }
            if (passText.Text == "")
            {
                err += "passが設定されていませんn";
            }
            if (remText.Text == "")
            {
                err += "アップロード場所が設定されていませんn";
            }
            if (uplab.Text == "")
            {
                err += "アップロードファイルが設定されていませんn";
            }
            var RadioGroup = groupFTP.Controls.OfType<RadioButton>().SingleOrDefault(rb => rb.Checked == true);
            if (RadioGroup == null) {
                err += "アップロード環境が設定されていませんn";
            }
            if (err != "")
            {
                MessageBox.Show(err);
            }
            else {
                if (RadioGroup.Text == "FTP") {
                    upFTP();
                }
                if (RadioGroup.Text == "SFTP")
                {
                    upSFTP();
                }
            }
        }
            private int upFTP() {
            try
            {
                // Setup session options
                SessionOptions sessionOptions = new SessionOptions
                {
                    Protocol = Protocol.Ftp,
                    HostName = hostText.Text,
                    UserName = idText.Text,
                    Password = passText.Text,
                    PortNumber =int.Parse(portText.Text)
                };
                using (Session session = new Session())
                {
                    // Connect
                    session.Open(sessionOptions);
                    // Upload files
                    TransferOptions transferOptions = new TransferOptions();
                    transferOptions.TransferMode = TransferMode.Binary;
                    TransferOperationResult transferResult;
                    if (remText.Text.EndsWith("/"))
                    {
                        transferResult = session.PutFiles(@uplab.Text, remText.Text, false, transferOptions);
                    }
                    else
                    {
                        transferResult = session.PutFiles(@uplab.Text, remText.Text + "/", false, transferOptions);
                    }
                    // Throw on any error
                    transferResult.Check();
                    // Print results
                    foreach (TransferEventArgs transfer in transferResult.Transfers)
                    {
                        MessageBox.Show("アップロードしました");
                    }
                }
                return 0;
            }
            catch (Exception e)
            {
                MessageBox.Show("Error: {0}" + e);
                return 1;
            }
        }
        private int upSFTP()
            {
                try
                {
                    // Setup session options
                    SessionOptions sessionOptions = new SessionOptions
                    {
                        Protocol = Protocol.Sftp,
                        HostName = hostText.Text,
                        UserName = idText.Text,
                        Password = passText.Text,
                        PortNumber = int.Parse(portText.Text),
                        GiveUpSecurityAndAcceptAnySshHostKey = true
                    };
                using (Session session = new Session())
                {
                    // Connect
                    session.Open(sessionOptions);
                    // Upload files
                    TransferOptions transferOptions = new TransferOptions();
                    transferOptions.TransferMode = TransferMode.Binary;
                    TransferOperationResult transferResult;
                    if (remText.Text.EndsWith("/")) {
                        transferResult = session.PutFiles(@uplab.Text, remText.Text, false, transferOptions);
                    } else {
                        transferResult = session.PutFiles(@uplab.Text, remText.Text + "/", false, transferOptions);
                    }
                        // Throw on any error
                        transferResult.Check();
                        // Print results
                        foreach (TransferEventArgs transfer in transferResult.Transfers)
                        {
                        MessageBox.Show("アップロードしました");
                        }
                    }
                    return 0;
                }
                catch (Exception e)
                {
                    MessageBox.Show("Error: {0}" + e);
                    return 1;
                }
            }
            private void Form1_DragDrop(object sender, DragEventArgs e) {
            //e.Effect = DragDropEffects.Copy;
            string[] fileName = (string[])e.Data.GetData(DataFormats.FileDrop, false);
            uplab.Text = fileName[0];
        }
        private void Form1_DragEnter(object sender, DragEventArgs e)
        {
            e.Effect = DragDropEffects.Copy;
        }
        private void radioSFTP_CheckedChanged(object sender, EventArgs e)
        {
            portText.Text = "22";
        }
        private void radioFTP_CheckedChanged(object sender, EventArgs e)
        {
            portText.Text = "21";
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;
        }
    }
}

著者名  @taoka_toshiaki

※この記事は著者が30代前半に書いたものです.

Profile
高知県在住の@taoka_toshiakiです、記事を読んで頂きありがとうございます.
数十年前から息を吸うように日々記事を書いてます.たまに休んだりする日もありますがほぼ毎日投稿を心掛けています😅.
SNSも使っています、フォロー、いいね、シェア宜しくお願い致します🙇.
SNS::@taoka_toshiaki

タグ

358, Collections, com, ComponentModel, data, Drawing, DropFTP, Forms, FTP, Generic, Linq, System, Tasks, Text, Threading, tool, using, Wi, Windows, WinSCP, zip, コード, こちら, ソース, ソフト, ダウンロード, ドップ, ファイル, ライブラリ, 一つ, 下記, , 会社, 使用, 業務, 疑問, 転送, 部分, 配布,