//Control gắn Watermark vào và download về máy public void DownloadFile(string id) { string FilePath = GoogleDriveFilesRepository.DownloadGoogleFile(id); file = new WaveSteg(new FileStream(FilePath, FileMode.Open, FileAccess.Read)); sh = new StagnoHelper(file); message = "Bản quyền thuộc về công ty TNHH KhueChin, bạn đã tải về lúc: " + DateTime.Now.ToString("HH:mm:ss dd-MM-yyyy zzz"); sh.HideMessage(message); file.WriteFile(FilePath); Response.ContentType = "application/zip"; Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(FilePath)); Response.WriteFile(System.Web.HttpContext.Current.Server.MapPath("~/GoogleDriveFiles/" + Path.GetFileName(FilePath))); Response.End(); Response.Flush(); }
public void DownloadFile(string id) { string FilePath = GoogleDriveFilesRepository.DownloadGoogleFile(id); file = new WaveSteg(new FileStream(FilePath, FileMode.Open, FileAccess.Read)); sh = new StagnoHelper(file); var sess = (UserLogin)Session[CommonConstants.User_Session]; message = sess.username; sh.HideMessage(message); file.WriteFile(FilePath); Response.ContentType = "application/zip"; Response.AddHeader("Content-Disposition", "attachment; filename=" + Path.GetFileName(FilePath)); Response.WriteFile(System.Web.HttpContext.Current.Server.MapPath("~/GoogleDriveFiles/" + Path.GetFileName(FilePath))); Response.End(); Response.Flush(); }
private void dlgBrowseFile_FileOk(object sender, CancelEventArgs e) { txtFilePath.Text = dlgBrowseFile.FileName; if (txtFilePath.Text.Trim() != "") { btnExtract.Enabled = true; btnHide.Enabled = true; file = new WaveAudio(new FileStream(txtFilePath.Text, FileMode.Open, FileAccess.Read)); sh = new StagnoHelper(file); } }
private void dlgSaveFile_FileOk(object sender, CancelEventArgs e) { file.WriteFile(dlgSaveFile.FileName); file = new WaveAudio(new FileStream(txtFilePath.Text, FileMode.Open, FileAccess.Read)); sh = new StagnoHelper(file); }