Tag: 附件

将文件作为附件发送后锁定文件

我发送文件作为附件: // Create the file attachment for this e-mail message. Attachment data = new Attachment(filePath, MediaTypeNames.Application.Octet); // Add time stamp information for the file. ContentDisposition disposition = data.ContentDisposition; disposition.CreationDate = System.IO.File.GetCreationTime(filePath); disposition.ModificationDate = System.IO.File.GetLastWriteTime(filePath); disposition.ReadDate = System.IO.File.GetLastAccessTime(filePath); // Add the file attachment to this e-mail message. message.Attachments.Add(data); 然后我想将文件移动到另一个文件夹,但是当我尝试这样做时 try { //File.Open(oldFullPath, FileMode.Open, FileAccess.ReadWrite,FileShare.ReadWrite); File.Move(oldFullPath, newFullPath); […]

使用.NET以编程方式管理Microsoft Access Attachment类型字段

Access在2007版本中添加了新数据类型 – 附件类型。 我们目前正在开发一个使用Access 2007数据库的.NET 3.5(C#)的WinForms应用程序。 我们希望能够通过WinForms界面添加新附件。 我似乎无法找到有关如何使用.NET插入或选择附件数据的任何信息。 我确实尝试使用DAO(版本12)但它似乎没有在这里讨论的SaveToFile或LoadFromFile方法: http : //msdn.microsoft.com/en-us/library/bb258184.aspx 那么,我如何使用.NET获取附件?