1234567891011121314151617181920212223242526272829303132333435 |
- namespace AipGateway.AIP.Service.Utils
- {
- public static class FileUtils
- {
- public static string GetFileData(string fileName)
- {
- string result = string.Empty;
- try
- {
- if (File.Exists(fileName))
- {
- byte[] fileBytes = File.ReadAllBytes(fileName);
- result = Convert.ToBase64String(fileBytes);
- }
- }
- catch (Exception)
- {
- return string.Empty;
- }
- return result;
- }
- public static void DeleteFile(string fileName)
- {
- try
- {
- if (File.Exists(fileName))
- {
- //File.Delete(fileName);
- }
- }
- catch (Exception) { }
- }
- }
- }
|