private void SelectFile() { try { if (sendFile != null) { label_filename.Text = Utils.ShortenDirString(sendFile.FullName); ToolTip tip = new ToolTip(); tip.SetToolTip(label_filename, sendFile.FullName); label_filesize.Text = String.Format(new FileSizeFormatProvider(), "{0:fs} ({0:#,##0} 바이트)", sendFile.Length); //예) 2.05MB(2,145,243 바이트) // 2.00GB(2,145,243,245 바이트) string clientKey = SocUtils.GenerateFTPClientKey(ConfigHelper.Id, WeDoCommon.Sockets.SocUtils.GetFileName(sendFile.FullName), sendFile.Length, receiverObj.Id); sendObj = new FTPSendObj(Members.GetLoginUserNode(receiverObj.Id), clientKey, sendFile.FullName, sendFile.Length, receiverObj.Id); ButtonFTPStart.Enabled = true; } else { ButtonFTPStart.Enabled = false; } } catch (Exception ex) { Logger.error(ex.ToString()); } }
private void SetValidFileName(string dirName) { realDownloadedFileName = SocUtils.GetValidFileName(dirName, rcvObj.FileName, 0); string shortenedFilePath = Utils.ShortenDirString(realDownloadedFileName); LabelFileName.Text = string.Format("파일명:{0}", Utils.ShortenString(shortenedFilePath, LabelFileName.Width - 70, LabelFileName.Font)); }
public static void AddClientKey(string fileName, long fileSize, string receiverId, string formKey) { string key = WeDoCommon.Sockets.SocUtils.GenerateFTPClientKey(ConfigHelper.Id, SocUtils.GetFileName(fileName), fileSize, receiverId); lock (lockObject) { mKeyMap[key] = formKey; Logger.info(string.Format("SendFileForm AddClientKey key[{0}]formkey[{1}]", key, formKey)); } }