Exemplo n.º 1
0
        private static void MakeJunction(string bn, string an)
        {
            if (Directory.Exists(an))
            {
                if (JunctionPoint.Exists(an))
                {
                    JunctionPoint.Delete(an);
                }
                else
                {
                    DirectoryInfo di = new DirectoryInfo(an);
                    FileInfo[]    fs = di.GetFiles("*.*", SearchOption.AllDirectories);

                    foreach (var f in fs)
                    {
                        f.Attributes = FileAttributes.Normal;
                    }

                    Directory.Delete(an, true);
                }
            }

            JunctionPoint.Create(bn, an, true);
        }
Exemplo n.º 2
0
        internal static void Make(string srcname, string tgtname)
        {
            if (Directory.Exists(tgtname))
            {
                if (JunctionPoint.Exists(tgtname))
                {
                    JunctionPoint.Delete(tgtname);
                }
                else
                {
                    DirectoryInfo di = new DirectoryInfo(tgtname);
                    FileInfo[]    fs = di.GetFiles("*.*", SearchOption.AllDirectories);

                    foreach (var f in fs)
                    {
                        f.Attributes = FileAttributes.Normal;
                    }

                    Directory.Delete(tgtname, true);
                }
            }

            JunctionPoint.Create(srcname, tgtname, true);
        }