Skip to content

Commit 1065dc1

Browse files
author
Abhith
committed
File helper added
1 parent 6b43771 commit 1065dc1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

Source/Code.Library/Code.Library/Code.Library.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
</ItemGroup>
4343
<ItemGroup>
4444
<Compile Include="ExceptionHelper.cs" />
45+
<Compile Include="FileHelper.cs" />
4546
<Compile Include="ImageHelper.cs" />
4647
<Compile Include="Properties\AssemblyInfo.cs" />
4748
<Compile Include="StringHelper.cs" />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System.IO;
2+
3+
namespace Code.Library
4+
{
5+
public static class FileHelper
6+
{
7+
/// <summary>
8+
/// Delete file
9+
/// Author : Abhith
10+
/// Date : 14 July 2015
11+
/// Reference : Sysberries
12+
/// </summary>
13+
/// <param name="fileName"></param>
14+
public static void DeleteFile(string fileName)
15+
{
16+
if (string.IsNullOrEmpty(fileName))
17+
{
18+
return;
19+
}
20+
21+
if (File.Exists(fileName))
22+
{
23+
File.Delete(fileName);
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)