Update metodi fileMover
This commit is contained in:
@@ -456,6 +456,37 @@ namespace SteamWare
|
||||
/// <summary>
|
||||
/// scrive il file dallo stream byte[] inviato
|
||||
/// </summary>
|
||||
/// <param name="_path"></param>
|
||||
/// <param name="_nomeFile"></param>
|
||||
/// <param name="_fileBuffer"></param>
|
||||
/// <returns></returns>
|
||||
public bool salvaFileBuffer(string _path, string _nomeFile, byte[] _fileBuffer)
|
||||
{
|
||||
_workPath = _path;
|
||||
DirectoryInfo _di = getDirectoryInfo(_path, true);
|
||||
if (!_di.Exists)
|
||||
{
|
||||
_di.Create();
|
||||
}
|
||||
FileInfo _fi = getFileInfoByName(_path, _nomeFile);
|
||||
Stream _stream;
|
||||
if (!_fi.Exists)
|
||||
{
|
||||
_stream = _fi.Create();
|
||||
}
|
||||
else
|
||||
{
|
||||
_stream = _fi.OpenWrite();
|
||||
}
|
||||
_stream.Write(_fileBuffer, 0, _fileBuffer.Length);
|
||||
_stream.Flush();
|
||||
_stream.Close();
|
||||
|
||||
return true;
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive il file dallo stream byte[] inviato
|
||||
/// </summary>
|
||||
/// <param name="_nomeFile"></param>
|
||||
/// <param name="_fileBuffer"></param>
|
||||
/// <returns></returns>
|
||||
@@ -485,6 +516,17 @@ namespace SteamWare
|
||||
/// <summary>
|
||||
/// scrive il file dalla stringa inviata
|
||||
/// </summary>
|
||||
/// <param name="_path"></param>
|
||||
/// <param name="_nomeFile"></param>
|
||||
/// <param name="_fileString"></param>
|
||||
/// <returns></returns>
|
||||
public bool salvaFileString(string _path, string _nomeFile, string _fileString)
|
||||
{
|
||||
return salvaFileBuffer(_path, _nomeFile, strToByte(_fileString));
|
||||
}
|
||||
/// <summary>
|
||||
/// scrive il file dalla stringa inviata
|
||||
/// </summary>
|
||||
/// <param name="_nomeFile"></param>
|
||||
/// <param name="_fileString"></param>
|
||||
/// <returns></returns>
|
||||
@@ -552,7 +594,7 @@ namespace SteamWare
|
||||
// verifica directory
|
||||
_pathFrom = verDir(_pathFrom);
|
||||
_pathTo = verDir(_pathTo);
|
||||
FileInfo _fi = getFileInfoByName(_nomeFile);
|
||||
FileInfo _fi = getFileInfoByName(_pathFrom, _nomeFile);
|
||||
try
|
||||
{
|
||||
_fi.CopyTo(_pathTo + _nomeFile, true);
|
||||
|
||||
Reference in New Issue
Block a user