首页 > Web开发 > 详细

.NET Transactional File Manager

时间:2015-04-09 19:15:58      阅读:244      评论:0      收藏:0      [点我收藏+]

.NET Transactional File Manager

http://transactionalfilemgr.codeplex.com/

对文件系统操作,比如copy, move, delete ,加入事务支持。

 

Project Description
Transactional File Manager is a .NET API that supports including file system operations such as file copy, move, delete, append, etc. in a transaction. Its an implementation of System.Transaction.IEnlistmentNotification (works with System.Transactions.TransactionScope).

This library allows you to wrap file system operations in transactions like this:

// Wrap a file copy and a database insert in the same transaction
TxFileManager fileMgr = new TxFileManager();
using (TransactionScope scope1 = new TransactionScope())
{
    // Copy a file
    fileMgr.Copy(srcFileName, destFileName);

    // Insert a database record
    dbMgr.ExecuteNonQuery(insertSql);

    scope1.Complete();
} 

 

.NET Transactional File Manager

原文:http://www.cnblogs.com/zfanlong1314/p/4410520.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!