[성현모] CPXV2 Init
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.IO;
|
||||
|
||||
namespace SystemX.Net.Platform.Common.Util
|
||||
{
|
||||
public class CwdChanger : IDisposable
|
||||
{
|
||||
protected string m_strBackupDirectory = null;
|
||||
|
||||
public CwdChanger() : this(null) { }
|
||||
public CwdChanger(string strTargetDirectory/*=null*/)
|
||||
{
|
||||
m_strBackupDirectory = Directory.GetCurrentDirectory();
|
||||
if (!String.IsNullOrEmpty(strTargetDirectory))
|
||||
Directory.SetCurrentDirectory(strTargetDirectory);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
Directory.SetCurrentDirectory(m_strBackupDirectory);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user