Пример #1
0
 public static void CreateFolderFromFilePath(string filePath)
 {
     if (!File.Exists(filePath))
     {
         Directory.CreateDirectory(UFile.GetFolder(filePath));
     }
 }
Пример #2
0
 public static void OpenContainingFolder(string filePath)
 {
     try
     {
         Process.Start("explorer select,", filePath);
     }
     catch
     {
         Open(UFile.GetFolder(filePath));
     }
 }
Пример #3
0
        private void Save()
        {
            if (BeforeSave != null)
            {
                BeforeSave(this, EventArgs.Empty);
            }

            bs.Visible = bc.Visible = false;
            be.Visible = bd.Visible = true;
            fu.Visible = false;

            if (PostedFileName != "")
            {
                string path = UWeb.MapPath(Url);

                if (path == "")
                {
                    path = UrlFolder;
                }
                {
                    UFile.Delete(path);
                }

                if (!RetainFileNameInEdit)
                {
                    path = UFile.GetFolder(path) + PostedFileName;
                }

                SaveAs(path);
            }

            SetValue(Url, ToolTip);

            if (AfterSave != null)
            {
                AfterSave(this, EventArgs.Empty);
            }
        }
Пример #4
0
 public static void Unzip(string zipFilePath, bool deleteZipFile)
 {
     Unzip(zipFilePath, UFile.GetFolder(zipFilePath), "", deleteZipFile);
 }