HtmlAgilityPack.HtmlWeb.FilePreparePath C# (CSharp) 메소드

FilePreparePath() 개인적인 정적인 메소드

private static FilePreparePath ( string target ) : void
target string
리턴 void
        private static void FilePreparePath(string target)
        {
            if (File.Exists(target))
            {
                FileAttributes atts = File.GetAttributes(target);
                File.SetAttributes(target, atts & ~FileAttributes.ReadOnly);
            }
            else
            {
                string dir = Path.GetDirectoryName(target);
                if (!Directory.Exists(dir))
                {
                    Directory.CreateDirectory(dir);
                }
            }
        }