码迷,mamicode.com
首页 > Web开发 > 详细

.NET Transactional File Manager

时间:2015-04-09 19:18:11      阅读:160      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!