Esempio n. 1
0
        void UpdateFileTransfer()
        {
            FileTransfer transfer = new FileTransfer();

            if (ttclient.GetFileTransferInfo(transferid, ref transfer))
            {
                if (transfer.nTransferred == transfer.nFileSize)
                {
                    timer1.Enabled = false;
                }
                filenameTextBox.Text = transfer.szRemoteFileName;
                filesizeTextBox.Text = transfer.nFileSize.ToString();

                if (transfer.nFileSize > 0)
                {
                    float percent = (float)transfer.nTransferred / (float)transfer.nFileSize;
                    progressBar1.Value = (int)(percent * 100.0f);
                }
            }
        }