using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Xml.Linq;
namespace CY_DocumentSynchroWCFService
{
///
/// 公告帮助类
///
public class CommonHelper
{
public CommonHelper()
{
}
///
/// 删除文件
///
///
///
public static bool DeleteFile(string filePath)
{
bool isSuccess = true;
try
{
if (File.Exists(filePath))
{
FileInfo fi = new FileInfo(filePath);
if (fi.Attributes.ToString().IndexOf("ReadOnly") != -1)
fi.Attributes = FileAttributes.Normal;
File.Delete(filePath);
}
}
catch (Exception ex)
{
isSuccess = false;
}
return isSuccess;
}
}
}