public static bool HasAds(string path) { if (!SupportsAds(path)) { return(false); } using (var sh = Kernel32Util.CreateFileForRead(path)) { return(!sh.IsInvalid); } }
public static string LoadAds(string path) { if (!SupportsAds(path)) { return(null); } using (var sh = Kernel32Util.CreateFileForRead(path)) { if (sh.IsInvalid) { return(null); } using (var stream = new StreamReader(new FileStream(sh, FileAccess.Read))) { return(stream.ReadToEnd()); } } }