/// <summary> /// Download Button /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DownloadFileButton_Click(object sender, EventArgs e) { Console.WriteLine("Download File"); IpfsBlkchn.DownloadFile(LookForCIDTextBox.Text, Globals.BLOCKGET_FILE_FOLDER + "\\dl.txt"); //List<string> cids = GetFileNameCID(); //for( int i = 1 ; i <= cids.Count - 1 ; i++) //{ // string pathTemporaryFile = cids[0] + ".tmp" // NEED TO CHECK HOW IT IS STORED WHEN // DownloadFile(cids[i], pathTemporaryFile); //} }
//public Filesys(Form1 f) public Filesys() { // form = f; watcher = new myWatcher(this); //initWatcher(); // ipfsblock = new IpfsBlkchn(this, f ); ipfsblock = new IpfsBlkchn(this); Console.WriteLine("New Object Filesys created"); //Check if filesys file already exists if (fsExists()) { Console.WriteLine("A copy of the file system has been found in the Blockget Folder and is put in memory"); listFileNamesCids = getCurrentState(); } }
/// <summary> /// Send button => Upload a file /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { if (String.Compare(buttonSend.Text, "Sending", false) == 0) { notifyIcon1.ShowBalloonTip(1000, "Important notice", "You interrupted the upload to IPFS", ToolTipIcon.Info); buttonSend.Text = "Send"; //source.Cancel(); //Console.WriteLine("Cancelling IPFS upload task"); } if (String.Compare(buttonSend.Text, "Send", false) == 0) { IpfsBlkchn.connectDCore(); if (!String.IsNullOrEmpty(textBoxFilePath.Text)) { Console.WriteLine("Upload File"); //First step: //uploadFile(textBoxFilePath.Text); //Second Step: fs.EncryptSplitUploadFile(textBoxFilePath.Text); //EncryptSplitUploadText(textBoxFilePath.Text); } } }